quasar.config.js 7.5 KB

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