webpack bundle jsファイルのコメントを削除しようとしています。 私はいくつかの方法を試してみましたが、それはまだ働いていないと私はバンドルされたファイルが巨大になっている。このためwebpack bundle jsファイルのコメントを取り除くことができません
"/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\ ...
のようなコメントを得ます。現在、1.6MBのサイズで巨大です。 私は私が間違っているかを理解することはできませんよ生産
set NODE_ENV=production
にも、この
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
},
mangle: {
except: ['$super', '$', 'exports', 'require']
},
output: {
comments: false
}
})
この
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
sourceMap: false,
output: false
})
また、設定的環境試してみました。 助けてください。 ありがとうございます。
ここで答えます:http://stackoverflow.com/questions/35846011/webpack-use-uglifyjsplugin-to-only-remove-comments – prosti
これを確認してください:http://stackoverflow.com/questions/41040266/remove-console -logs-with-webpack-uglify/41041580#41041580 –