UglifyJsPlugin options.exclude does not work?
See original GitHub issueWhen using the UglifyJsPlugin within my webpack build I get a large list of errors from my bower_components
dependencies. It looks to me (from here: https://github.com/webpack/webpack/blob/master/lib/optimize/UglifyJsPlugin.js#L43) that I should be able to use something like this
new webpack.optimize.UglifyJsPlugin({
exclude: [
/bower_components\//
]
})
which continues to throw out a massive list of errors, leading me to believe they are still being parsed.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:17 (6 by maintainers)
Top Results From Across the Web
How to exclude uglification for *.min.js in webpack
UglifyJsPlugin always runs on the entire webpack JS output. There is no way to specify any chunks or modules to ignore o exclude....
Read more >UglifyjsWebpackPlugin
This plugin uses UglifyJS v3 ( uglify-es ) to minify your JavaScript ... Files to exclude ... cheap-source-map options don't work with this...
Read more >UglifyjsWebpackPlugin
This plugin uses uglify-js to minify your JavaScript. ... Files to exclude. webpack.config.js ... cheap-source-map options don't work with this plugin.
Read more >uglifyjs-webpack-plugin - npm
This plugin uses UglifyJS v3 (`uglify-es`) to minify your JavaScript ... cheap-source-map options don't work with this plugin ...
Read more >demo/node_modules/uglifyjs-webpack-plugin - GitLab
exclude. webpack.config.js. [ new UglifyJsPlugin({ exclude: /\/excludes/ }) ] ... cheap-source-map options don't work with this plugin ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s working as expected, which is processing your generated chunks rather than source files. If you want to ignore only a few modules, extract them into a separate chunk and exclude that one from UglifyJsPlugin.
@Sawtaytoes