vue.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const CompressionWebpackPlugin = require('compression-webpack-plugin');
  2. const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
  3. module.exports = {
  4. productionSourceMap: false,
  5. configureWebpack: {
  6. performance: {
  7. maxAssetSize: 2000000,
  8. maxEntrypointSize: 2000000
  9. }
  10. },
  11. chainWebpack(config) {
  12. config.plugins.delete('prefetch');
  13. if (process.env.NODE_ENV !== 'development') {
  14. // gzip 压缩
  15. config.plugin('compressionPlugin').use(
  16. new CompressionWebpackPlugin({
  17. test: /\.(js|css|html)$/,
  18. threshold: 10240
  19. })
  20. );
  21. }
  22. },
  23. css: {
  24. loaderOptions: {
  25. sass: {
  26. sassOptions: {
  27. outputStyle: 'expanded',
  28. importer: transformElementScss()
  29. }
  30. }
  31. }
  32. },
  33. devServer: { //liu
  34. proxy: {
  35. '/kingdom': {
  36. target: 'http://192.168.3.51:18086',
  37. // target: 'http://192.168.3.35:8080', // kang杨威
  38. // target: 'http://192.168.3.31:8080', // 黄峥嵘
  39. changeOrigin: true,
  40. pathRewrite: {
  41. "^/kingdom": '',
  42. }
  43. },
  44. },
  45. },
  46. };