Skip to content

Commit 07967aa

Browse files
committed
add gulp-newer
1 parent b2de0a6 commit 07967aa

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ build/Release
2626
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
2727
node_modules
2828
public
29+
.o2

gulp-tasks/imgmin.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ module.exports = function(){
1717
.pipe($.ignore.include(function(file){
1818
return imgRegx.test(file.path);
1919
}))
20+
.pipe($.newer(dirs.hidden))
2021
.pipe($.imagemin({
2122
progressive: true,
2223
svgoPlugins: [{removeViewBox:false}],
2324
use:[pngquant()]
24-
}));
25+
}))
26+
// in order to make newer work, we need to put a copy to the hidden folder
27+
.pipe(gulp.dest(dirs.hidden))
28+
// override the raw files
29+
.pipe(gulp.dest(dirs.public));
2530
};

gulpfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var gulp = require('gulp'),
2222
css: 'public/css',
2323
js: 'public/js',
2424
temp: 'temp',
25+
hidden: '.o2',
2526
assetsDir:'public/assets'
2627
};
2728

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"gulp-load-plugins": "^1.1.0",
4040
"gulp-minify-css": "^1.2.1",
4141
"gulp-minify-html": "^1.0.4",
42+
"gulp-newer": "^1.1.0",
4243
"gulp-postcss": "^6.0.1",
4344
"gulp-rename": "^1.2.2",
4445
"gulp-replace": "^0.5.4",

themes/o2

Submodule o2 updated from e97db7e to f173d77

0 commit comments

Comments
 (0)