mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-25 16:08:02 +00:00
Merge pull request #103 from abhisheksoni27/develop
Strip comments and mangled output for browser build
This commit is contained in:
commit
52fc1e6090
13
gulpfile.js
vendored
13
gulpfile.js
vendored
@ -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'));
|
||||
});
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user