How to remove dead code, but don't minimize code, using Webpack and UglifyJS?
1 Answer
You probably want to use the beautifier options. Minimum idea:
new webpack.optimize.UglifyJsPlugin({ beautify: true }) 4 Comments
Juho Vepsäläinen
See github.com/mishoo/UglifyJS2#compressor-options . Esp.
dead_code. I read the initial description wrong.grucha
But whai if I only want to remove dead code and leave everything untouched? Beautifier transforms my code in many different ways.
Juho Vepsäläinen
Maybe disable everything else then. I have a feeling Uglify wasn't designed particularly that use case in mind so using that feature alone may be tricky.
grucha
I got that feeling too because I already have disabled everything else and it still minimizes (unless I tell it to beutify but as I said before - that also transforms my code)