quasar.conf.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. * This file runs in a Node context (it's NOT transpiled by Babel), so use only
  3. * the ES6 features that are supported by your Node version. https://node.green/
  4. */
  5. // Configuration for your app
  6. // https://v2.quasar.dev/quasar-cli/quasar-conf-js
  7. /* eslint-env node */
  8. const ESLintPlugin = require('eslint-webpack-plugin');
  9. const { configure } = require('quasar/wrappers');
  10. const envparser = require('./env.js');
  11. module.exports = configure((ctx) => ({
  12. // https://v2.quasar.dev/quasar-cli/supporting-ts
  13. supportTS: false,
  14. // https://v2.quasar.dev/quasar-cli/prefetch-feature
  15. // preFetch: true,
  16. // app boot file (/src/boot)
  17. // --> boot files are part of "main.js"
  18. // https://v2.quasar.dev/quasar-cli/boot-files
  19. boot: [],
  20. // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
  21. css: ['app.scss'],
  22. // https://github.com/quasarframework/quasar/tree/dev/extras
  23. extras: [
  24. // 'ionicons-v4',
  25. // 'mdi-v5',
  26. // 'fontawesome-v5',
  27. // 'eva-icons',
  28. // 'themify',
  29. // 'line-awesome',
  30. // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
  31. 'roboto-font', // optional, you are not bound to it
  32. 'material-icons', // optional, you are not bound to it
  33. ],
  34. // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
  35. build: {
  36. env: envparser(),
  37. vueRouterMode: 'hash', // available values: 'hash', 'history'
  38. // transpile: false,
  39. // Add dependencies for transpiling with Babel (Array of string/regex)
  40. // (from node_modules, which are by default not transpiled).
  41. // Applies only if "transpile" is set to true.
  42. // transpileDependencies: [],
  43. // rtl: true, // https://v2.quasar.dev/options/rtl-support
  44. // preloadChunks: true,
  45. // showProgress: false,
  46. // gzip: true,
  47. // analyze: true,
  48. // Options below are automatically set depending on the env, set them if you want to override
  49. // extractCSS: false,
  50. // https://v2.quasar.dev/quasar-cli/handling-webpack
  51. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  52. chainWebpack(chain) {
  53. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js', 'vue'] }]);
  54. },
  55. },
  56. // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
  57. devServer: {
  58. https: false,
  59. port: 10001,
  60. open: false, // opens browser window automatically
  61. proxy: {
  62. '/api': {
  63. target: 'http://127.0.0.1:19035',
  64. changeOrigin: true,
  65. pathRewrite: {
  66. '^/api': '',
  67. },
  68. },
  69. },
  70. },
  71. // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
  72. framework: {
  73. config: {},
  74. // iconSet: 'material-icons', // Quasar icon set
  75. lang: 'zh-CN', // Quasar language pack
  76. // For special cases outside of where the auto-import stategy can have an impact
  77. // (like functional components as one of the examples),
  78. // you can manually specify Quasar components/directives to be available everywhere:
  79. //
  80. // components: [],
  81. // directives: [],
  82. // Quasar plugins
  83. plugins: ['Dialog', 'Notify', 'AppFullscreen'],
  84. },
  85. // animations: 'all', // --- includes all animations
  86. // https://v2.quasar.dev/options/animations
  87. animations: [],
  88. // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
  89. ssr: {
  90. pwa: false,
  91. // manualStoreHydration: true,
  92. // manualPostHydrationTrigger: true,
  93. prodPort: 3000, // The default port that the production server should use
  94. // (gets superseded if process.env.PORT is specified at runtime)
  95. maxAge: 1000 * 60 * 60 * 24 * 30,
  96. // Tell browser when a file from the server should expire from cache (in ms)
  97. chainWebpackWebserver(chain) {
  98. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  99. },
  100. middlewares: [
  101. ctx.prod ? 'compression' : '',
  102. 'render', // keep this as last one
  103. ],
  104. },
  105. // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
  106. pwa: {
  107. workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest'
  108. workboxOptions: {}, // only for GenerateSW
  109. // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
  110. // if using workbox in InjectManifest mode
  111. chainWebpackCustomSW(chain) {
  112. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  113. },
  114. manifest: {
  115. name: `ChineseSubFinder Panel`,
  116. short_name: `CSF Panel`,
  117. description: `ChineseSubFinder Panel`,
  118. display: 'standalone',
  119. orientation: 'portrait',
  120. background_color: '#ffffff',
  121. theme_color: '#027be3',
  122. icons: [
  123. {
  124. src: 'icons/android-chrome-192x192.png',
  125. sizes: '192x192',
  126. type: 'image/png',
  127. },
  128. {
  129. src: 'icons/android-chrome-512x512.png',
  130. sizes: '512x512',
  131. type: 'image/png',
  132. },
  133. ],
  134. },
  135. },
  136. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
  137. cordova: {
  138. // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
  139. },
  140. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
  141. capacitor: {
  142. hideSplashscreen: true,
  143. },
  144. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
  145. electron: {
  146. bundler: 'packager', // 'packager' or 'builder'
  147. packager: {
  148. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  149. // OS X / Mac App Store
  150. // appBundleId: '',
  151. // appCategoryType: '',
  152. // osxSign: '',
  153. // protocol: 'myapp://path',
  154. // Windows only
  155. // win32metadata: { ... }
  156. },
  157. builder: {
  158. // https://www.electron.build/configuration/configuration
  159. appId: 'us-500',
  160. },
  161. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  162. chainWebpackMain(chain) {
  163. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  164. },
  165. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  166. chainWebpackPreload(chain) {
  167. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  168. },
  169. },
  170. }));