quasar.config.js 7.1 KB

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