John Liu .NET

View Original

How to tell WebPack Uglify to support IE8

Many that uses WebPack also applies the UglifyjsPlugin.  By default, UglifyJS doesn't support IE8.  There's a few problems that we'll see:

IE8's non-standard catch is a keyword, so as a property it will be renamed to "catch": and promise["catch"]()

IE8's non-standard class is a keyword, so similarly it needs to be escaped as "class".

The UglifyJS settings needed for WebPack.config is this:

See this content in the original post

 

Yes, by default, UglifyJS has screw_ie8 = true