August 2017
Beginner
298 pages
7h 4m
English
This is a plugin that is used for compressing and minifying JavaScript files. This greatly reduces the size of the JavaScript code and increases the loading speed for end users. However, using this plugin during development will cause Webpack to slow down, since it adds an extra step to the build process (expensive task). Hence, UglifyJsPlugin is usually used only on production environments. To do so, add the following lines at the end of your Webpack configuration:
if(isProduction) { module.exports.plugins.push( new webpack.optimize.UglifyJsPlugin({sourceMap: true}) );}
This will push UglifyJSPlugin to the plugins array if the environment is set to production. More information regarding UglifyJsPlugin can be found at: https://webpack.js.org/plugins/uglifyjs-webpack-plugin/ ...
Read now
Unlock full access