Skip to content

Commit

Permalink
add rev deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Sep 11, 2015
1 parent 55065a1 commit 88d7ca1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
25 changes: 23 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var Rx = require('rx'),
// rev
rev = require('gulp-rev'),
revReplace = require('gulp-rev-replace'),
revDel = require('rev-del'),

// lint
jsonlint = require('gulp-jsonlint'),
Expand Down Expand Up @@ -72,8 +73,7 @@ var paths = {
],

dependents: [
'client/commonFramework.js',
'client/sandbox.js'
'client/commonFramework.js'
],

less: './client/less/main.less',
Expand Down Expand Up @@ -191,6 +191,10 @@ gulp.task('pack-client', function() {
.pipe(gulp.dest(webpackConfig.output.path))
// create and merge manifest
.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));
});

Expand Down Expand Up @@ -241,6 +245,10 @@ gulp.task('pack-watch-manifest', function() {
.pipe(gulp.dest(webpackConfig.output.path))
// create manifest
.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));
});

Expand All @@ -267,6 +275,10 @@ gulp.task('less', function() {
.pipe(gulp.dest(paths.css))
// create and merge manifest
.pipe(rev.manifest('css-manifest.json'))
.pipe(revDel({
oldManifest: path.join(paths.manifest, 'css-manifest.json'),
dest: paths.css
}))
.pipe(gulp.dest(paths.manifest));
});

Expand All @@ -280,6 +292,10 @@ gulp.task('js', function() {
.pipe(gulp.dest(paths.publicJs))
// create manifest file
.pipe(rev.manifest('js-manifest.json'))
.pipe(revDel({
oldManifest: path.join(paths.manifest, 'js-manifest.json'),
dest: paths.publicJs
}))
// copy manifest file to dest
.pipe(gulp.dest(paths.manifest));
});
Expand All @@ -294,9 +310,14 @@ gulp.task('dependents', ['js'], function() {
return gulp.src(paths.dependents)
.pipe(plumber({ errorHandler: errorHandler }))
.pipe(revReplace({ manifest: manifest }))
.pipe(gulp.dest(paths.publicJs))
.pipe(rev())
.pipe(gulp.dest(paths.publicJs))
.pipe(rev.manifest('dependents-manifest.json'))
.pipe(revDel({
oldManifest: path.join(paths.manifest, 'dependents-manifest.json'),
dest: paths.publicJs
}))
.pipe(gulp.dest(paths.manifest));
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
"react-vimeo": "^0.0.3",
"request": "~2.53.0",
"rev-del": "^1.0.5",
"rx": "^2.5.3",
"sanitize-html": "~1.6.1",
"sort-keys": "^1.1.1",
Expand Down

0 comments on commit 88d7ca1

Please sign in to comment.