add rev deletion
This commit is contained in:
25
gulpfile.js
25
gulpfile.js
@ -29,6 +29,7 @@ var Rx = require('rx'),
|
|||||||
// rev
|
// rev
|
||||||
rev = require('gulp-rev'),
|
rev = require('gulp-rev'),
|
||||||
revReplace = require('gulp-rev-replace'),
|
revReplace = require('gulp-rev-replace'),
|
||||||
|
revDel = require('rev-del'),
|
||||||
|
|
||||||
// lint
|
// lint
|
||||||
jsonlint = require('gulp-jsonlint'),
|
jsonlint = require('gulp-jsonlint'),
|
||||||
@ -72,8 +73,7 @@ var paths = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
dependents: [
|
dependents: [
|
||||||
'client/commonFramework.js',
|
'client/commonFramework.js'
|
||||||
'client/sandbox.js'
|
|
||||||
],
|
],
|
||||||
|
|
||||||
less: './client/less/main.less',
|
less: './client/less/main.less',
|
||||||
@ -191,6 +191,10 @@ gulp.task('pack-client', function() {
|
|||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
.pipe(gulp.dest(webpackConfig.output.path))
|
||||||
// create and merge manifest
|
// create and merge manifest
|
||||||
.pipe(rev.manifest('react-manifest.json'))
|
.pipe(rev.manifest('react-manifest.json'))
|
||||||
|
.pipe(revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, 'react-manifest.json'),
|
||||||
|
dest: webpackConfig.output.path
|
||||||
|
}))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -241,6 +245,10 @@ gulp.task('pack-watch-manifest', function() {
|
|||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
.pipe(gulp.dest(webpackConfig.output.path))
|
||||||
// create manifest
|
// create manifest
|
||||||
.pipe(rev.manifest('react-manifest.json'))
|
.pipe(rev.manifest('react-manifest.json'))
|
||||||
|
.pipe(revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, 'react-manifest.json'),
|
||||||
|
dest: webpackConfig.output.path
|
||||||
|
}))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -267,6 +275,10 @@ gulp.task('less', function() {
|
|||||||
.pipe(gulp.dest(paths.css))
|
.pipe(gulp.dest(paths.css))
|
||||||
// create and merge manifest
|
// create and merge manifest
|
||||||
.pipe(rev.manifest('css-manifest.json'))
|
.pipe(rev.manifest('css-manifest.json'))
|
||||||
|
.pipe(revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, 'css-manifest.json'),
|
||||||
|
dest: paths.css
|
||||||
|
}))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -280,6 +292,10 @@ gulp.task('js', function() {
|
|||||||
.pipe(gulp.dest(paths.publicJs))
|
.pipe(gulp.dest(paths.publicJs))
|
||||||
// create manifest file
|
// create manifest file
|
||||||
.pipe(rev.manifest('js-manifest.json'))
|
.pipe(rev.manifest('js-manifest.json'))
|
||||||
|
.pipe(revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, 'js-manifest.json'),
|
||||||
|
dest: paths.publicJs
|
||||||
|
}))
|
||||||
// copy manifest file to dest
|
// copy manifest file to dest
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
@ -294,9 +310,14 @@ gulp.task('dependents', ['js'], function() {
|
|||||||
return gulp.src(paths.dependents)
|
return gulp.src(paths.dependents)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
.pipe(revReplace({ manifest: manifest }))
|
.pipe(revReplace({ manifest: manifest }))
|
||||||
|
.pipe(gulp.dest(paths.publicJs))
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
.pipe(gulp.dest(paths.publicJs))
|
.pipe(gulp.dest(paths.publicJs))
|
||||||
.pipe(rev.manifest('dependents-manifest.json'))
|
.pipe(rev.manifest('dependents-manifest.json'))
|
||||||
|
.pipe(revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, 'dependents-manifest.json'),
|
||||||
|
dest: paths.publicJs
|
||||||
|
}))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@
|
|||||||
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
|
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
|
||||||
"react-vimeo": "^0.0.3",
|
"react-vimeo": "^0.0.3",
|
||||||
"request": "~2.53.0",
|
"request": "~2.53.0",
|
||||||
|
"rev-del": "^1.0.5",
|
||||||
"rx": "^2.5.3",
|
"rx": "^2.5.3",
|
||||||
"sanitize-html": "~1.6.1",
|
"sanitize-html": "~1.6.1",
|
||||||
"sort-keys": "^1.1.1",
|
"sort-keys": "^1.1.1",
|
||||||
|
Reference in New Issue
Block a user