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