quasar.config.js 7.7 KB

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