Gulp Uglify Options not applying

主宰稳场 提交于 2019-12-22 06:59:08

问题


Hi I am making a theme for the company i work at and the JS segments will not build properly in uglify. I am trying to use uglify to simply concatenate my files, which works but they output minified and mangled with no comments and i cannot figure out why, below is my gulp task which runs correctly but doesnt output with the options provided

gulp.task('js', function() {
return gulp.src('./src/js/*.js')
    .pipe(uglify({
        options: {
            mangle: false,
            beautify: true,
            comments: true
        }
    }))
    .pipe(rename('cf247bootstrapTheme.js'))
    .pipe(gulp.dest('./dist/js'));
});

Any ideas why this is happening?

Thanks,

Kieran


回答1:


Probably options are not passed as expected.

Try this for uglify pipe:

.pipe(uglify({
    mangle: false,
    output: {
        beautify: true,
        comments: true
    }
})


来源:https://stackoverflow.com/questions/37542620/gulp-uglify-options-not-applying

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!