quasar.config.js 7.7 KB

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