quasar.conf.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. ws: true,
  66. pathRewrite: {
  67. '^/api': '',
  68. },
  69. },
  70. },
  71. },
  72. // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
  73. framework: {
  74. config: {},
  75. // iconSet: 'material-icons', // Quasar icon set
  76. lang: 'zh-CN', // Quasar language pack
  77. // For special cases outside of where the auto-import stategy can have an impact
  78. // (like functional components as one of the examples),
  79. // you can manually specify Quasar components/directives to be available everywhere:
  80. //
  81. // components: [],
  82. // directives: [],
  83. // Quasar plugins
  84. plugins: ['Dialog', 'Notify', 'AppFullscreen', 'Loading'],
  85. },
  86. // animations: 'all', // --- includes all animations
  87. // https://v2.quasar.dev/options/animations
  88. animations: [],
  89. // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
  90. ssr: {
  91. pwa: false,
  92. // manualStoreHydration: true,
  93. // manualPostHydrationTrigger: true,
  94. prodPort: 3000, // The default port that the production server should use
  95. // (gets superseded if process.env.PORT is specified at runtime)
  96. maxAge: 1000 * 60 * 60 * 24 * 30,
  97. // Tell browser when a file from the server should expire from cache (in ms)
  98. chainWebpackWebserver(chain) {
  99. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  100. },
  101. middlewares: [
  102. ctx.prod ? 'compression' : '',
  103. 'render', // keep this as last one
  104. ],
  105. },
  106. // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
  107. pwa: {
  108. workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest'
  109. workboxOptions: {}, // only for GenerateSW
  110. // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
  111. // if using workbox in InjectManifest mode
  112. chainWebpackCustomSW(chain) {
  113. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  114. },
  115. manifest: {
  116. name: `ChineseSubFinder Panel`,
  117. short_name: `CSF Panel`,
  118. description: `ChineseSubFinder Panel`,
  119. display: 'standalone',
  120. orientation: 'portrait',
  121. background_color: '#ffffff',
  122. theme_color: '#027be3',
  123. icons: [
  124. {
  125. src: 'icons/android-chrome-192x192.png',
  126. sizes: '192x192',
  127. type: 'image/png',
  128. },
  129. {
  130. src: 'icons/android-chrome-512x512.png',
  131. sizes: '512x512',
  132. type: 'image/png',
  133. },
  134. ],
  135. },
  136. },
  137. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
  138. cordova: {
  139. // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
  140. },
  141. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
  142. capacitor: {
  143. hideSplashscreen: true,
  144. },
  145. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
  146. electron: {
  147. bundler: 'packager', // 'packager' or 'builder'
  148. packager: {
  149. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  150. // OS X / Mac App Store
  151. // appBundleId: '',
  152. // appCategoryType: '',
  153. // osxSign: '',
  154. // protocol: 'myapp://path',
  155. // Windows only
  156. // win32metadata: { ... }
  157. },
  158. builder: {
  159. // https://www.electron.build/configuration/configuration
  160. appId: 'us-500',
  161. },
  162. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  163. chainWebpackMain(chain) {
  164. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  165. },
  166. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  167. chainWebpackPreload(chain) {
  168. chain.plugin('eslint-webpack-plugin').use(ESLintPlugin, [{ extensions: ['js'] }]);
  169. },
  170. },
  171. }));