Search code examples
gulpconcatenationgulp-uglify

Gulp Uglify Options not applying


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


Solution

  • Probably options are not passed as expected.

    Try this for uglify pipe:

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