2
0

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