mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Switch from Rimraf to Del for deleting in Gulp.
This commit is contained in:
parent
9dec7a1a77
commit
bb20e3a4a7
2 changed files with 20 additions and 10 deletions
29
gulpfile.js
29
gulpfile.js
|
@ -14,14 +14,14 @@ var gulp = require('gulp'),
|
|||
qunit = require('gulp-qunit'),
|
||||
prepro = require('gulp-prepro'),
|
||||
rename = require('gulp-rename'),
|
||||
rimraf = require('gulp-rimraf'),
|
||||
shell = require('gulp-shell'),
|
||||
symlink = require('gulp-symlink'),
|
||||
uglify = require('gulp-uglify'),
|
||||
uncomment = require('gulp-uncomment'),
|
||||
whitespace = require('gulp-whitespace'),
|
||||
zip = require('gulp-zip'),
|
||||
merge = require('merge-stream'),
|
||||
del = require('del'),
|
||||
zip = require('gulp-zip'),
|
||||
gitty = require('gitty')('.'),
|
||||
fs = require('fs');
|
||||
|
||||
|
@ -48,6 +48,8 @@ var uglifyOptions = {
|
|||
var buildNames = Object.keys(buildOptions);
|
||||
var docNames = Object.keys(docOptions);
|
||||
|
||||
gulp.task('default', ['dist']);
|
||||
|
||||
gulp.on('error', function(err) {
|
||||
console.error(err.toString());
|
||||
gulp.emit('end');
|
||||
|
@ -59,7 +61,7 @@ gulp.task('test', function() {
|
|||
});
|
||||
|
||||
docNames.forEach(function(name) {
|
||||
gulp.task('docs:' + name, shell.task([
|
||||
gulp.task('docs:' + name, ['clean:docs'], shell.task([
|
||||
'java -cp jsrun.jar:lib/* JsRun app/run.js -c=conf/' + name + '.conf ' +
|
||||
'-D="renderMode:' + docOptions[name] + '"',
|
||||
], {
|
||||
|
@ -69,6 +71,13 @@ docNames.forEach(function(name) {
|
|||
|
||||
gulp.task('docs', ['docs:local']);
|
||||
|
||||
gulp.task('clean:docs', function(callback) {
|
||||
return del([
|
||||
'dist/docs/**',
|
||||
'dist/serverdocs/**'
|
||||
]);
|
||||
});
|
||||
|
||||
gulp.task('load', ['clean:load'], function() {
|
||||
return gulp.src('src/load.js')
|
||||
.pipe(symlink('dist/paper-full.js'))
|
||||
|
@ -76,11 +85,10 @@ gulp.task('load', ['clean:load'], function() {
|
|||
});
|
||||
|
||||
gulp.task('clean:load', function() {
|
||||
return gulp.src([
|
||||
'dist/paper-full.js',
|
||||
'dist/paper-node.js'
|
||||
], { read: false })
|
||||
.pipe(rimraf());
|
||||
return del([
|
||||
'dist/paper-full.js',
|
||||
'dist/paper-node.js'
|
||||
]);
|
||||
});
|
||||
|
||||
gulp.task('build',
|
||||
|
@ -150,8 +158,9 @@ buildNames.forEach(function(name) {
|
|||
gulp.task('build:start', ['clean:build', 'minify:acorn']);
|
||||
|
||||
gulp.task('clean:build', function() {
|
||||
return gulp.src('dist/paper-*.js', { read: false })
|
||||
.pipe(rimraf());
|
||||
return del([
|
||||
'dist/paper-*.js'
|
||||
]);
|
||||
});
|
||||
|
||||
gulp.task('minify:acorn', function() {
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
"canvas": ">=1.2.9 <2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"del": "^2.2.0",
|
||||
"gitty": "^3.3.3",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-prepro": "^2.0.0",
|
||||
|
|
Loading…
Reference in a new issue