quasar.config.js 7.5 KB

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