Skip to content

Commit fb1919c

Browse files
'去除打包插件'
1 parent bd0d4fc commit fb1919c

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

vue.config.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ const path = require('path');
33
function resolve (dir) {
44
return path.join(__dirname, dir);
55
}
6-
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
7-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
8-
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
9-
const CompressionWebpackPlugin = require('compression-webpack-plugin');
10-
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
11-
const productionGzipExtensions = ['js', 'css', 'html']
6+
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
7+
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
8+
// const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
9+
// const CompressionWebpackPlugin = require('compression-webpack-plugin');
10+
// const ProgressBarPlugin = require('progress-bar-webpack-plugin');
11+
// const productionGzipExtensions = ['js', 'css', 'html']
1212

1313
module.exports = {
1414
publicPath: process.env.NODE_ENV === 'production'
@@ -18,15 +18,15 @@ module.exports = {
1818
lintOnSave: true,
1919
configureWebpack: {
2020
plugins: [
21-
new ProgressBarPlugin(),
22-
new BundleAnalyzerPlugin(),
23-
new CompressionWebpackPlugin({
24-
filename: '[path].gz[query]',
25-
algorithm: 'gzip',
26-
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$',),
27-
threshold: 10240,//仅处理大于此大小的资产。以字节为单位。
28-
minRatio: 0.8,
29-
}),
21+
// new ProgressBarPlugin(),
22+
// new BundleAnalyzerPlugin(),
23+
// new CompressionWebpackPlugin({
24+
// filename: '[path].gz[query]',
25+
// algorithm: 'gzip',
26+
// test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$',),
27+
// threshold: 10240,//仅处理大于此大小的资产。以字节为单位。
28+
// minRatio: 0.8,
29+
// }),
3030
],
3131
optimization: {
3232
// splitChunks: {
@@ -58,34 +58,34 @@ module.exports = {
5858
// },
5959
// }
6060
// },
61-
minimizer: [new UglifyJsPlugin(
62-
{
63-
uglifyOptions: {
64-
compress: {
65-
reduce_vars: true,// 把使用多次的静态值自动定义为变量
66-
drop_debugger: true,// 删除所有的debugger语句
67-
drop_console: true,// 删除所有的console语句
68-
},
69-
parallel: true, // 允许并发
70-
cache: true, // 开启缓存
71-
output: {
72-
beautify: false // 使输出的代码尽可能紧凑
73-
}
74-
},
75-
}
76-
),
77-
new CssMinimizerPlugin({
78-
parallel: true,// 多并发执行
79-
minimizerOptions: {
80-
preset: [
81-
"default",
82-
{
83-
discardComments: { removeAll: true },//移除所有注释
84-
},
85-
],
86-
},
87-
})],
88-
61+
// minimizer: [
62+
// new UglifyJsPlugin(
63+
// {
64+
// uglifyOptions: {
65+
// compress: {
66+
// reduce_vars: true,// 把使用多次的静态值自动定义为变量
67+
// drop_debugger: true,// 删除所有的debugger语句
68+
// drop_console: true,// 删除所有的console语句
69+
// },
70+
// parallel: true, // 允许并发
71+
// cache: true, // 开启缓存
72+
// output: {
73+
// beautify: false // 使输出的代码尽可能紧凑
74+
// }
75+
// },
76+
// }
77+
// ),
78+
// new CssMinimizerPlugin({
79+
// parallel: true,// 多并发执行
80+
// minimizerOptions: {
81+
// preset: [
82+
// "default",
83+
// {
84+
// discardComments: { removeAll: true },//移除所有注释
85+
// },
86+
// ],
87+
// },
88+
// })],
8989
},
9090
},
9191
chainWebpack: (config) => {

0 commit comments

Comments
 (0)