quasar.config.js 7.4 KB

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