How to disable uglify-js optimization which removes quotes around object literals?

I have this (legacy) code:

var object = {
  'in': 'someThing'

After uglify-js optimization code looks like:

var object = {
  in: 'someThing'

Here is lines from uglify-js readme (features list):

various small optimizations that may lead to faster code but certainly lead to smaller code. Where possible, we do the following:

foo[“bar”] =>

How to disable this optimisation? It ruins the application in IE8STD.



According to the Documentation of UglifyJS, you could use this option:

-ns or --no-squeeze — don’t call ast_squeeze() (which does various optimizations that result in smaller, less readable code).


Flag --screw-ie8 is the solution. Check out the documentation.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.