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.

34 lines
1.1KB

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