quasar.config.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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: ["axios", "globalMixin"],
  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. "line-awesome",
  34. ],
  35. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-build
  36. build: {
  37. vueRouterMode: "history", // available values: 'hash', 'history'
  38. // transpile: false,
  39. // publicPath: '/',
  40. // Add dependencies for transpiling with Babel (Array of string/regex)
  41. // (from node_modules, which are by default not transpiled).
  42. // Applies only if "transpile" is set to true.
  43. // transpileDependencies: [],
  44. // rtl: true, // https://quasar.dev/options/rtl-support
  45. // preloadChunks: true,
  46. // showProgress: false,
  47. // gzip: true,
  48. // analyze: true,
  49. // Options below are automatically set depending on the env, set them if you want to override
  50. // extractCSS: false,
  51. // https://v2.quasar.dev/quasar-cli-webpack/handling-webpack
  52. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  53. chainWebpack(chain) {
  54. chain
  55. .plugin("eslint-webpack-plugin")
  56. .use(ESLintPlugin, [{ extensions: ["js", "vue"] }]);
  57. },
  58. },
  59. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-devServer
  60. devServer: {
  61. server: {
  62. type: "http",
  63. },
  64. port: 9583,
  65. open: true, // opens browser window automatically
  66. },
  67. // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-framework
  68. framework: {
  69. config: { notify: {} },
  70. // iconSet: 'material-icons', // Quasar icon set
  71. // lang: 'en-US', // Quasar language pack
  72. // For special cases outside of where the auto-import strategy can have an impact
  73. // (like functional components as one of the examples),
  74. // you can manually specify Quasar components/directives to be available everywhere:
  75. //
  76. // components: [],
  77. // directives: [],
  78. // Quasar plugins
  79. plugins: ["Notify"],
  80. },
  81. // animations: 'all', // --- includes all animations
  82. // https://quasar.dev/options/animations
  83. animations: [],
  84. // https://v2.quasar.dev/quasar-cli-webpack/developing-ssr/configuring-ssr
  85. ssr: {
  86. pwa: false,
  87. // manualStoreHydration: true,
  88. // manualPostHydrationTrigger: true,
  89. prodPort: 3000, // The default port that the production server should use
  90. // (gets superseded if process.env.PORT is specified at runtime)
  91. maxAge: 1000 * 60 * 60 * 24 * 30,
  92. // Tell browser when a file from the server should expire from cache (in ms)
  93. chainWebpackWebserver(chain) {
  94. chain
  95. .plugin("eslint-webpack-plugin")
  96. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  97. },
  98. middlewares: [
  99. ctx.prod ? "compression" : "",
  100. "render", // keep this as last one
  101. ],
  102. },
  103. // https://v2.quasar.dev/quasar-cli-webpack/developing-pwa/configuring-pwa
  104. pwa: {
  105. workboxPluginMode: "GenerateSW", // 'GenerateSW' or 'InjectManifest'
  106. workboxOptions: {}, // only for GenerateSW
  107. // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
  108. // if using workbox in InjectManifest mode
  109. chainWebpackCustomSW(chain) {
  110. chain
  111. .plugin("eslint-webpack-plugin")
  112. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  113. },
  114. manifest: {
  115. name: `Hichina Main Site Mobile First`,
  116. short_name: `Hichina Main Site Mobile First`,
  117. description: `A Quasar Project`,
  118. display: "standalone",
  119. orientation: "portrait",
  120. background_color: "#ffffff",
  121. theme_color: "#027be3",
  122. icons: [
  123. {
  124. src: "icons/icon-128x128.png",
  125. sizes: "128x128",
  126. type: "image/png",
  127. },
  128. {
  129. src: "icons/icon-192x192.png",
  130. sizes: "192x192",
  131. type: "image/png",
  132. },
  133. {
  134. src: "icons/icon-256x256.png",
  135. sizes: "256x256",
  136. type: "image/png",
  137. },
  138. {
  139. src: "icons/icon-384x384.png",
  140. sizes: "384x384",
  141. type: "image/png",
  142. },
  143. {
  144. src: "icons/icon-512x512.png",
  145. sizes: "512x512",
  146. type: "image/png",
  147. },
  148. ],
  149. },
  150. },
  151. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-cordova-apps/configuring-cordova
  152. cordova: {
  153. // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
  154. },
  155. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-capacitor-apps/configuring-capacitor
  156. capacitor: {
  157. hideSplashscreen: true,
  158. },
  159. // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-electron-apps/configuring-electron
  160. electron: {
  161. bundler: "packager", // 'packager' or 'builder'
  162. packager: {
  163. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  164. // OS X / Mac App Store
  165. // appBundleId: '',
  166. // appCategoryType: '',
  167. // osxSign: '',
  168. // protocol: 'myapp://path',
  169. // Windows only
  170. // win32metadata: { ... }
  171. },
  172. builder: {
  173. // https://www.electron.build/configuration/configuration
  174. appId: "hichina-main-front-mobile-first",
  175. },
  176. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  177. chainWebpackMain(chain) {
  178. chain
  179. .plugin("eslint-webpack-plugin")
  180. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  181. },
  182. chainWebpackPreload(chain) {
  183. chain
  184. .plugin("eslint-webpack-plugin")
  185. .use(ESLintPlugin, [{ extensions: ["js"] }]);
  186. },
  187. },
  188. };
  189. });