You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 satır
992B

  1. const CompressionWebpackPlugin = require('compression-webpack-plugin');
  2. module.exports = {
  3. devServer: {
  4. open: true,
  5. proxy: {
  6. "/api": {
  7. target: "http://47.98.157.120:9031/",
  8. changeOrigin: true,
  9. // pathRewrite: {
  10. // "^/api": "/"
  11. // }
  12. }
  13. }
  14. },
  15. productionSourceMap: false,
  16. transpileDependencies: ['element-ui'], // 需要兼容IE10要放开这个
  17. chainWebpack: config => {
  18. config.plugin('html').tap(options => {
  19. options[0].title = '经发局考核管理系统';
  20. return options;
  21. });
  22. if (process.env.NODE_ENV === 'production') {
  23. config.plugin('compressionPlugin').use(new CompressionWebpackPlugin({
  24. test: /\.(js|css|less)$/,
  25. threshold: 10240, // 对超过10kb的文件压缩
  26. deleteOriginalAssets: false
  27. }));
  28. }
  29. }
  30. }