quasar.config.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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 = ctx.dev ? {
  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: false,
  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.build.rollupOptions = {
  80. ...viteConf.build.rollupOptions ?? {},
  81. output: {
  82. manualChunks: {
  83. lodash: ['lodash-es', 'lodash'],
  84. quasar: ['quasar', 'quasar/src/components']
  85. }
  86. }
  87. }
  88. viteConf.optimizeDeps.include = [
  89. 'prosemirror-state',
  90. 'prosemirror-transform',
  91. 'prosemirror-model',
  92. 'prosemirror-view'
  93. ]
  94. },
  95. // viteVuePluginOptions: {},
  96. vitePlugins: [
  97. ['@intlify/unplugin-vue-i18n/vite', {
  98. // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
  99. // compositionOnly: false,
  100. // you need to set i18n resource including paths !
  101. include: path.resolve(__dirname, './src/i18n/locales/**')
  102. }]
  103. ]
  104. },
  105. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
  106. devServer: {
  107. // https: true
  108. open: false, // opens browser window automatically
  109. port: userConfig.dev?.port,
  110. proxy: {
  111. '/_graphql': `http://127.0.0.1:${userConfig.port}/_graphql`,
  112. '/_site': `http://127.0.0.1:${userConfig.port}`,
  113. '/_thumb': `http://127.0.0.1:${userConfig.port}`,
  114. '/_user': `http://127.0.0.1:${userConfig.port}`
  115. },
  116. hmr: {
  117. clientPort: userConfig.dev?.hmrClientPort
  118. },
  119. vueDevtools: true
  120. },
  121. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
  122. framework: {
  123. config: {
  124. brand: {
  125. header: '#000',
  126. sidebar: '#1976D2'
  127. },
  128. loading: {
  129. delay: 500,
  130. spinner: 'QSpinnerGrid',
  131. spinnerSize: 32,
  132. spinnerColor: 'white',
  133. customClass: 'loading-darker'
  134. },
  135. loadingBar: {
  136. color: 'primary',
  137. size: '1px',
  138. position: 'top'
  139. },
  140. notify: {
  141. position: 'top',
  142. progress: true,
  143. color: 'green',
  144. icon: 'las la-check',
  145. actions: [
  146. {
  147. icon: 'las la-times',
  148. color: 'white',
  149. size: 'sm',
  150. round: true,
  151. handler: () => {}
  152. }
  153. ]
  154. }
  155. },
  156. iconSet: 'mdi-v7', // Quasar icon set
  157. lang: 'en-US', // Quasar language pack
  158. // For special cases outside of where the auto-import strategy can have an impact
  159. // (like functional components as one of the examples),
  160. // you can manually specify Quasar components/directives to be available everywhere:
  161. //
  162. // components: [],
  163. // directives: [],
  164. // Quasar plugins
  165. plugins: [
  166. 'Dialog',
  167. 'Loading',
  168. 'LoadingBar',
  169. 'Meta',
  170. 'Notify'
  171. ]
  172. },
  173. // animations: 'all', // --- includes all animations
  174. // https://v2.quasar.dev/options/animations
  175. animations: [],
  176. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#property-sourcefiles
  177. sourceFiles: {
  178. // rootComponent: 'src/App.vue',
  179. // router: 'src/router/index',
  180. store: 'src/stores/index'
  181. // registerServiceWorker: 'src-pwa/register-service-worker',
  182. // serviceWorker: 'src-pwa/custom-service-worker',
  183. // pwaManifestFile: 'src-pwa/manifest.json',
  184. // electronMain: 'src-electron/electron-main',
  185. // electronPreload: 'src-electron/electron-preload'
  186. },
  187. // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
  188. ssr: {
  189. // ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
  190. // will mess up SSR
  191. // extendSSRWebserverConf (esbuildConf) {},
  192. // extendPackageJson (json) {},
  193. pwa: false,
  194. // manualStoreHydration: true,
  195. // manualPostHydrationTrigger: true,
  196. prodPort: 3000, // The default port that the production server should use
  197. // (gets superseded if process.env.PORT is specified at runtime)
  198. middlewares: [
  199. 'render' // keep this as last one
  200. ]
  201. },
  202. // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
  203. pwa: {
  204. workboxMode: 'generateSW', // or 'injectManifest'
  205. injectPwaMetaTags: true,
  206. swFilename: 'sw.js',
  207. manifestFilename: 'manifest.json',
  208. useCredentialsForManifestTag: false
  209. // extendGenerateSWOptions (cfg) {}
  210. // extendInjectManifestOptions (cfg) {},
  211. // extendManifestJson (json) {}
  212. // extendPWACustomSWConf (esbuildConf) {}
  213. },
  214. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
  215. electron: {
  216. // extendElectronMainConf (esbuildConf)
  217. // extendElectronPreloadConf (esbuildConf)
  218. inspectPort: 5858,
  219. bundler: 'packager', // 'packager' or 'builder'
  220. packager: {
  221. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  222. // OS X / Mac App Store
  223. // appBundleId: '',
  224. // appCategoryType: '',
  225. // osxSign: '',
  226. // protocol: 'myapp://path',
  227. // Windows only
  228. // win32metadata: { ... }
  229. },
  230. builder: {
  231. // https://www.electron.build/configuration/configuration
  232. appId: 'ux'
  233. }
  234. }
  235. }
  236. })