diff --git a/gulpfile.js b/gulpfile.js index 7c52a5a7ad..4aeea066c6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'), @@ -72,8 +73,7 @@ var paths = { ], dependents: [ - 'client/commonFramework.js', - 'client/sandbox.js' + 'client/commonFramework.js' ], less: './client/less/main.less', @@ -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)); }); @@ -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)); }); @@ -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)); }); @@ -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)); }); @@ -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)); }); diff --git a/package.json b/package.json index 9be7048cbe..901b54ea3a 100644 --- a/package.json +++ b/package.json @@ -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",