Merge pull request #103 from abhisheksoni27/develop

Strip comments and mangled output for browser build
This commit is contained in:
Robert Plummer 2017-06-30 14:35:16 -04:00 committed by GitHub
commit 52fc1e6090
2 changed files with 7 additions and 7 deletions

13
gulpfile.js vendored
View File

@ -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'));
});

View File

@ -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",