Permalink
Browse files

Améliore les tâches Gulp, notamment en supprimant les fichiers non ve…

…rsionnées du répertoire dist
  • Loading branch information...
2ec0b4 committed Jun 23, 2016
1 parent f7982f2 commit 3d0457e3fc9a09f1088a4f615b41a0650adca74f
Showing with 7 additions and 4 deletions.
  1. +6 −4 gulpfile.js
  2. +1 −0 package.json
View
@@ -5,16 +5,18 @@ var gulp = require('gulp'),
syncy = require('syncy'),
runSequence = require('run-sequence'),
RevAll = require('gulp-rev-all'),
- revReplace = require('gulp-rev-replace');
+ revReplace = require('gulp-rev-replace'),
+ revDel = require('gulp-rev-delete-original');
gulp.task("rev-all", function(){
var revAll = new RevAll({
- dontGlobal: [/^\/favicon.ico$/g, /^\/sounds\/(.+)\.mp3/g],
+ dontGlobal: [/^\/favicons\/favicon\.ico$/g, /^\/sounds\/(.+)\.mp3/g],
dontRenameFile: [/^\/index\.html/g, /^\/robots\.txt/g, /^\/img\/ks\.jpg/g]
});
- return gulp.src(['dist/**'])
+ return gulp.src(['dist/**', '!dist/bower_components/**'])
.pipe(revAll.revision())
+ .pipe(revDel())
.pipe(gulp.dest('dist'))
.pipe(revAll.manifestFile())
.pipe(gulp.dest('dist'));
@@ -58,7 +60,7 @@ gulp.task('clean', function() {
});
gulp.task('sync', function() {
- syncy(['.htaccess', './css/**', './favicons/**', './img/**', './js/**', 'index.html', 'robots.txt', './sounds/**'], 'dist', {
+ syncy(['.htaccess', './bower_components/**', './css/**', './favicons/**', './img/**', './js/**', 'index.html', 'robots.txt', './sounds/**'], 'dist', {
updateAndDelete: true,
}).on('error', console.error).end();
});
View
@@ -26,6 +26,7 @@
"gulp-cssnano": "^2.1.2",
"gulp-rev": "^7.0.0",
"gulp-rev-all": "^0.8.24",
+ "gulp-rev-delete-original": "^0.1.0",
"gulp-rev-replace": "^0.4.3",
"gulp-uglify": "^1.5.3",
"run-sequence": "^1.2.1",

0 comments on commit 3d0457e

Please sign in to comment.