S
S
sanex33392015-08-03 10:55:21
JavaScript
sanex3339, 2015-08-03 10:55:21

Why is Gulp-Uglify's keep_fnames setting not working?

It is necessary that gulp-uglify does not minimize function names during minification (variable names need to be minimized), in order to be able to get the class name in es6 (babel) through this.constructor.name. With minification gives the name of the minified function - 'e'.
I set the keep_fnames parameter, but uglify successfully ignores it, and produces the same code, both with true and false.

.pipe(uglify({
       compress: {
           'keep_fnames': true
       }
   }))

What am I doing wrong?
PS: if you set mangle: false, then neither function names nor variables are minified, which does not suit me, variables should be minified.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Khokhlov, 2015-08-03
@sanex3339

Try like this:

.pipe(uglify({
    mangle: {
        keep_fnames: true
    }
}))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question