How to fix --mangle-props error in uglify browserify?

26 Views Asked by At

I'm new to this, so I'm encountering an error. Basically I'm using this browserify entry.js -d | uglifyjs -c -m --mangle-props --toplevel -o bundle.js, where --mangle-props would be 'mangle' properties, the problem is that it is mangling browserify imports too.

With --mangle-props

1: [function(r, e, t) {
        e.exports = {name: 'Sky'}
    },{}],

2: [function(r, e, t) {
        var {} = r("./errors")
    },{ t: 1}] //error is Here

No --mangle-props (normal)

1: [function(r, e, t) {
        e.exports = {name: 'Sky'}
    },{}],

2: [function(r, e, t) {
        var {} = r("./errors")
    },{ "./errors": 1}]

If I change t: 1 to "./errors": 1, it works. but I would have to do this on everything, after packing, does anyone have a solution? I don't know if it's correct to use this platform to ask this type of question.

0

There are 0 best solutions below