diff --git a/gulpfile.js b/gulpfile.js index 66200878..c0aa1d23 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,7 +11,8 @@ const source = require('vinyl-source-stream'); const buffer = require('vinyl-buffer'); const pkg = require('./package.json'); const jsprettify = require('gulp-jsbeautifier'); -const babel = require("gulp-babel"); +const babel = require('gulp-babel'); +const stripComments = require('gulp-strip-comments'); /// Build the scripts gulp.task('build', function() { @@ -19,6 +20,7 @@ gulp.task('build', function() { .bundle() .pipe(source('gpu.js')) .pipe(buffer()) + .pipe(stripComments()) .pipe(babel()) .pipe(header(fs.readFileSync('./src/wrapper/prefix.js', 'utf8'), { pkg : pkg })) .pipe(gulp.dest('bin')); @@ -29,12 +31,9 @@ gulp.task('minify', ['build'], function() { return gulp.src('bin/gpu.js') .pipe(rename('gpu.min.js')) .pipe( - uglify({ - mangle: false, - preserveComments: 'license' - }) - .on('error', gutil.log) - ) + uglify({preserveComments: 'license'}) + .on('error', gutil.log) + ) .pipe(gulp.dest('bin')); }); diff --git a/package.json b/package.json index 6a9d6ca3..960bf231 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "gulp-header": "^1.7.1", "gulp-jsbeautifier": "^2.1.0", "gulp-rename": "^1.2.2", + "gulp-strip-comments": "^2.4.5", "gulp-uglify": "^1.5.2", "gulp-util": "^3.0.7", "qunit-assert-close": "^2.1.2",