webpack: Unable to disable comment preserving in uglifyjs plugin
Trying to do this: new webpack.optimize.UglifyJsPlugin({ comments: false })
Setting will be overwritten because of this: https://github.com/webpack/webpack/blob/master/lib/optimize/UglifyJsPlugin.js#L79
Other reference: https://github.com/mishoo/UglifyJS2/blob/master/lib/output.js#L62
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Stronger check and override of comments in UglifyJsPlugin options Fixes https://github.com/webpack/webpack/issues/324 — committed to dashed/webpack by dashed 9 years ago
- Stronger check and override of comments in UglifyJsPlugin options Fixes https://github.com/webpack/webpack/issues/324 — committed to dashed/webpack by dashed 9 years ago
- Don't require license to be included by bundlers #96 updated the license to zero clause BSD so that bundlers didn't need to keep the license intact. However, the `/*!` still signifies to bundlers ... — committed to penx/tslib by penx 3 years ago
Yes that’s a bug… Workaround:
new webpack.optimize.UglifyJsPlugin({ output: {comments: false} })
Look at this mess:
So many comments that I dont need!
btw. it’s intended that webpack preserves some comments. This is for legal reasons. By default comments with
@license
,@preserve
or starting with/*!
are preserved.