Skip to content

Cannot uglify on Gulp #66

Description

@jcfrane

Hi,

I was trying to uglify my vendor files with gulp.

It produces this error:

GulpUglifyError: unable to minify JavaScript
Caused by: SyntaxError: Unexpected token: name (Commented)

When I tried to remove angular-wamp with my dependency the error is gone.
So I suspect that angular-wamp must be the cause.

Heres my gulp task

//build prod scripts
gulp.task('build', [], function() {

    // build vendors
    var vb = browserify({
        debug: true
    });

    vendors.forEach(function(vendor) {
        vb.require(vendor);
    });

    vb
        .bundle()
        .pipe(source('vendors.js'))
        .pipe(buffer())
        .pipe(uglify({
            mangle: false
        }))
        .pipe(gulp.dest('./web/dist/js/'))
    ;

    var b = browserify({
        entries: './web/app/gol88/app.module.js',
        debug: true,
        paths: ['./web/app/gol88/**/*.js'],
    });

    b.transform(ngAnnotate);

    return b
        .external(vendors)
        .bundle()
        .on('error', swallowError)
        .pipe(source('bundle.js'))
        //.pipe(gAnnotate())
        .pipe(buffer())
        .pipe(uglify({
            mangle: false
        }))
        .on('error', swallowError)
        .pipe(gulp.dest('./web/dist/js/'));
});

Why is that so?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions