vue.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. changeOrigin: true,
  39. pathRewrite: {
  40. "^/kingdom": '',
  41. }
  42. },
  43. },
  44. },
  45. };