quasar.config.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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-webpack/quasar-config-js
  8. const ESLintPlugin = require("eslint-webpack-plugin");
  9. const { configure } = require("quasar/wrappers");
  10. module.exports = configure(function (ctx) {
  11. return {
  12. // https://v2.quasar.dev/quasar-cli-webpack/supporting-ts
  13. supportTS: false,
  14. // https://v2.quasar.dev/quasar-cli-webpack/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-webpack/boot-files
  19. boot: [],
  20. // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-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-v6',
  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-webpack/quasar-config-js#Property%3A-build
  35. build: {
  36. vueRouterMode: "history", // available values: 'hash', 'history'
  37. // transpile: false,
  38. // publicPath: '/',
  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://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-webpack/handling-webpack
  51. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  52. chainWebpack(chain) {
  53. chain
  54. .plugin("eslint-webpack-plugin")
  55. .use(ESLintPlugin, [{ extensions: ["js", "vue"] }]);
  56. },
  57. },
  58. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-devServer
  59. devServer: {
  60. server: {
  61. type: "http",
  62. },
  63. port: 9051,
  64. open: true, // opens browser window automatically
  65. },
  66. // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-framework
  67. framework: {
  68. config: {
  69. notify: {
  70. /* look at QuasarConfOptions from the API card */
  71. },
  72. },
  73. // iconSet: 'material-icons', // Quasar icon set
  74. // lang: 'en-US', // Quasar language pack
  75. // For special cases outside of where the auto-import strategy can have an impact
  76. // (like functional components as one of the examples),
  77. // you can manually specify Quasar components/directives to be available everywhere:
  78. //
  79. // components: [],
  80. // directives: [],
  81. // Quasar plugins
  82. plugins: ["Notify"],
  83. },
  84. // animations: 'all', // --- includes all animations
  85. // https://quasar.dev/options/animations
  86. animations: [],
  87. // https://v2.quasar.dev/quasar-cli-webpack/developing-ssr/configuring-ssr
  88. ssr: {
  89. pwa: false,
  90. // manualStoreHydration: true,
  91. // manualPostHydrationTrigger: true,
  92. prodPort: 3000, // The default port that the production server should use
  93. // (gets superseded if process.env.PORT is specified at runtime)
  94. maxAge: 1000 * 60 * 60 * 24 * 30,
  95. // Tell browser when a file from the server should expire from cache (in ms)
  96. chainWebpackWebserver(chain) {
  97. chain
  98. .plugin("eslint-webpack-plugin")
  99. .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-webpack/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
  114. .plugin("eslint-webpack-plugin")
  115. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  116. },
  117. manifest: {
  118. name: `Hichina Admin`,
  119. short_name: `Hichina Admin`,
  120. description: `A Quasar Project`,
  121. display: "standalone",
  122. orientation: "portrait",
  123. background_color: "#ffffff",
  124. theme_color: "#027be3",
  125. icons: [
  126. {
  127. src: "icons/icon-128x128.png",
  128. sizes: "128x128",
  129. type: "image/png",
  130. },
  131. {
  132. src: "icons/icon-192x192.png",
  133. sizes: "192x192",
  134. type: "image/png",
  135. },
  136. {
  137. src: "icons/icon-256x256.png",
  138. sizes: "256x256",
  139. type: "image/png",
  140. },
  141. {
  142. src: "icons/icon-384x384.png",
  143. sizes: "384x384",
  144. type: "image/png",
  145. },
  146. {
  147. src: "icons/icon-512x512.png",
  148. sizes: "512x512",
  149. type: "image/png",
  150. },
  151. ],
  152. },
  153. },
  154. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-cordova-apps/configuring-cordova
  155. cordova: {
  156. // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
  157. },
  158. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-capacitor-apps/configuring-capacitor
  159. capacitor: {
  160. hideSplashscreen: true,
  161. },
  162. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-electron-apps/configuring-electron
  163. electron: {
  164. bundler: "packager", // 'packager' or 'builder'
  165. packager: {
  166. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  167. // OS X / Mac App Store
  168. // appBundleId: '',
  169. // appCategoryType: '',
  170. // osxSign: '',
  171. // protocol: 'myapp://path',
  172. // Windows only
  173. // win32metadata: { ... }
  174. },
  175. builder: {
  176. // https://www.electron.build/configuration/configuration
  177. appId: "hichina-admin-front",
  178. },
  179. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  180. chainWebpackMain(chain) {
  181. chain
  182. .plugin("eslint-webpack-plugin")
  183. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  184. },
  185. chainWebpackPreload(chain) {
  186. chain
  187. .plugin("eslint-webpack-plugin")
  188. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  189. },
  190. },
  191. };
  192. });