vue.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const path = require('path');
  2. function resolve(dir = '') {
  3. return path.join(__dirname, './src', dir);
  4. }
  5. module.exports = {
  6. publicPath: './',
  7. outputDir: 'dist',
  8. assetsDir: 'static',
  9. productionSourceMap: false,
  10. devServer: {
  11. //九键输入法的 「mall」= 「6255」
  12. port: 6255,
  13. proxy: {
  14. '/wx': {
  15. target: 'https://www.cityihealth.com/litemall/'
  16. },
  17. },
  18. },
  19. chainWebpack: config => {
  20. config.plugins.delete('prefetch');
  21. config.plugins.delete('preload');
  22. },
  23. configureWebpack: {
  24. resolve: {
  25. alias: {
  26. core: resolve('core')
  27. }
  28. },
  29. optimization: {
  30. runtimeChunk: {
  31. name: entrypoint => `runtime~${entrypoint.name}`
  32. },
  33. splitChunks: {
  34. minChunks: 2,
  35. minSize: 20000,
  36. maxAsyncRequests: 20,
  37. maxInitialRequests: 30,
  38. name: false
  39. }
  40. }
  41. },
  42. css: {
  43. loaderOptions: {
  44. sass: {
  45. data:
  46. '@import "@/assets/scss/_var.scss";@import "@/assets/scss/_mixin.scss";'
  47. }
  48. }
  49. }
  50. };