quasar.config.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /* eslint-env node */
  2. /*
  3. * This file runs in a Node context (it's NOT transpiled by Babel), so use only
  4. * the ES6 features that are supported by your Node version. https://node.green/
  5. */
  6. // Configuration for your app
  7. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
  8. const { configure } = require('quasar/wrappers')
  9. const path = require('path')
  10. const yaml = require('js-yaml')
  11. const fs = require('fs')
  12. module.exports = configure(function (/* ctx */) {
  13. const userConfig = {
  14. dev: { port: 3001, hmrClientPort: 3001 },
  15. ...yaml.load(fs.readFileSync(path.resolve(__dirname, '../config.yml'), 'utf8'))
  16. }
  17. return {
  18. eslint: {
  19. fix: true,
  20. // include = [],
  21. // exclude = [],
  22. // rawOptions = {},
  23. warnings: true,
  24. errors: true
  25. },
  26. // https://v2.quasar.dev/quasar-cli/prefetch-feature
  27. preFetch: true,
  28. // app boot file (/src/boot)
  29. // --> boot files are part of "main.js"
  30. // https://v2.quasar.dev/quasar-cli/boot-files
  31. boot: [
  32. 'apollo',
  33. 'components',
  34. 'eventbus',
  35. 'i18n',
  36. {
  37. server: false,
  38. path: 'monaco'
  39. }
  40. ],
  41. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
  42. css: [
  43. 'app.scss'
  44. ],
  45. // https://github.com/quasarframework/quasar/tree/dev/extras
  46. extras: [
  47. // 'ionicons-v4',
  48. // 'mdi-v5',
  49. // 'mdi-v7',
  50. // 'fontawesome-v6',
  51. // 'eva-icons',
  52. // 'themify',
  53. 'line-awesome'
  54. // 'roboto-font-latin-ext' // this or either 'roboto-font', NEVER both!
  55. // 'roboto-font', // optional, you are not bound to it
  56. // 'material-icons' // optional, you are not bound to it
  57. ],
  58. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
  59. build: {
  60. target: {
  61. browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
  62. node: 'node18'
  63. },
  64. vueRouterMode: 'history', // available values: 'hash', 'history'
  65. // vueRouterBase,
  66. // vueDevtools,
  67. // vueOptionsAPI: true,
  68. rebuildCache: true, // rebuilds Vite/linter/etc cache on startup
  69. // publicPath: '/',
  70. // analyze: true,
  71. // env: {},
  72. // rawDefine: {}
  73. // ignorePublicFolder: true,
  74. // minify: false,
  75. // polyfillModulePreload: true,
  76. distDir: '../assets',
  77. extendViteConf (viteConf) {
  78. viteConf.build.assetsDir = '_assets'
  79. // viteConf.resolve.alias.vue = '/workspace/ux/node_modules/vue/dist/vue.esm-bundler.js'
  80. // viteConf.build.rollupOptions = {
  81. // ...viteConf.build.rollupOptions ?? {},
  82. // external: [
  83. // /^\/_site\//
  84. // ]
  85. // }
  86. viteConf.optimizeDeps.include = [
  87. 'prosemirror-state',
  88. 'prosemirror-transform',
  89. 'prosemirror-model',
  90. 'prosemirror-view'
  91. ]
  92. viteConf.build.rollupOptions = {
  93. external: ['monaco-editor'],
  94. output: {
  95. globals: {
  96. 'monaco-editor': 'monaco-editor'
  97. }
  98. }
  99. }
  100. },
  101. // viteVuePluginOptions: {},
  102. vitePlugins: [
  103. ['@intlify/unplugin-vue-i18n/vite', {
  104. // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
  105. // compositionOnly: false,
  106. // you need to set i18n resource including paths !
  107. include: path.resolve(__dirname, './src/i18n/locales/**')
  108. }]
  109. ]
  110. },
  111. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
  112. devServer: {
  113. // https: true
  114. open: false, // opens browser window automatically
  115. port: userConfig.dev.port,
  116. proxy: {
  117. '/_graphql': `http://127.0.0.1:${userConfig.port}/_graphql`,
  118. '/_site': `http://127.0.0.1:${userConfig.port}`,
  119. '/_thumb': `http://127.0.0.1:${userConfig.port}`,
  120. '/_user': `http://127.0.0.1:${userConfig.port}`
  121. },
  122. hmr: {
  123. clientPort: userConfig.dev.hmrClientPort
  124. }
  125. },
  126. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
  127. framework: {
  128. config: {
  129. brand: {
  130. header: '#000',
  131. sidebar: '#1976D2'
  132. },
  133. loading: {
  134. delay: 500,
  135. spinner: 'QSpinnerGrid',
  136. spinnerSize: 32,
  137. spinnerColor: 'white',
  138. customClass: 'loading-darker'
  139. },
  140. loadingBar: {
  141. color: 'primary',
  142. size: '1px',
  143. position: 'top'
  144. },
  145. notify: {
  146. position: 'top',
  147. progress: true,
  148. color: 'green',
  149. icon: 'las la-check',
  150. actions: [
  151. {
  152. icon: 'las la-times',
  153. color: 'white',
  154. size: 'sm',
  155. round: true,
  156. handler: () => {}
  157. }
  158. ]
  159. }
  160. },
  161. iconSet: 'mdi-v7', // Quasar icon set
  162. lang: 'en-US', // Quasar language pack
  163. // For special cases outside of where the auto-import strategy can have an impact
  164. // (like functional components as one of the examples),
  165. // you can manually specify Quasar components/directives to be available everywhere:
  166. //
  167. // components: [],
  168. // directives: [],
  169. // Quasar plugins
  170. plugins: [
  171. 'Dialog',
  172. 'Loading',
  173. 'LoadingBar',
  174. 'Meta',
  175. 'Notify'
  176. ]
  177. },
  178. // animations: 'all', // --- includes all animations
  179. // https://v2.quasar.dev/options/animations
  180. animations: [],
  181. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#property-sourcefiles
  182. sourceFiles: {
  183. // rootComponent: 'src/App.vue',
  184. // router: 'src/router/index',
  185. store: 'src/stores/index'
  186. // registerServiceWorker: 'src-pwa/register-service-worker',
  187. // serviceWorker: 'src-pwa/custom-service-worker',
  188. // pwaManifestFile: 'src-pwa/manifest.json',
  189. // electronMain: 'src-electron/electron-main',
  190. // electronPreload: 'src-electron/electron-preload'
  191. },
  192. // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
  193. ssr: {
  194. // ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
  195. // will mess up SSR
  196. // extendSSRWebserverConf (esbuildConf) {},
  197. // extendPackageJson (json) {},
  198. pwa: false,
  199. // manualStoreHydration: true,
  200. // manualPostHydrationTrigger: true,
  201. prodPort: 3000, // The default port that the production server should use
  202. // (gets superseded if process.env.PORT is specified at runtime)
  203. middlewares: [
  204. 'render' // keep this as last one
  205. ]
  206. },
  207. // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
  208. pwa: {
  209. workboxMode: 'generateSW', // or 'injectManifest'
  210. injectPwaMetaTags: true,
  211. swFilename: 'sw.js',
  212. manifestFilename: 'manifest.json',
  213. useCredentialsForManifestTag: false
  214. // extendGenerateSWOptions (cfg) {}
  215. // extendInjectManifestOptions (cfg) {},
  216. // extendManifestJson (json) {}
  217. // extendPWACustomSWConf (esbuildConf) {}
  218. },
  219. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
  220. electron: {
  221. // extendElectronMainConf (esbuildConf)
  222. // extendElectronPreloadConf (esbuildConf)
  223. inspectPort: 5858,
  224. bundler: 'packager', // 'packager' or 'builder'
  225. packager: {
  226. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  227. // OS X / Mac App Store
  228. // appBundleId: '',
  229. // appCategoryType: '',
  230. // osxSign: '',
  231. // protocol: 'myapp://path',
  232. // Windows only
  233. // win32metadata: { ... }
  234. },
  235. builder: {
  236. // https://www.electron.build/configuration/configuration
  237. appId: 'ux'
  238. }
  239. }
  240. }
  241. })