File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2- var gutil = require ( 'gulp-util' ) ;
3- var PluginError = gutil . PluginError ;
42var through = require ( 'through2' ) ;
53var path = require ( 'path' ) ;
64
@@ -20,7 +18,7 @@ function plugin(keepQuantity) {
2018 }
2119 lists [ identifier ] . push ( {
2220 file : file ,
23- time : file . stat . ctime . getTime ( )
21+ time : file . stat . mtime . getTime ( )
2422 } ) ;
2523 }
2624 cb ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " gulp-rev-outdated" ,
3- "version" : " 0.1.1 " ,
3+ "version" : " 1.0.0 " ,
44 "description" : " Old static asset revision files filter" ,
55 "license" : " MIT" ,
66 "repository" : {
4343 " filter"
4444 ],
4545 "dependencies" : {
46- "gulp-util " : " ^3.0.0" ,
47- "through2 " : " >=0.5.1 "
46+ "through2 " : " ^3.0.0" ,
47+ "vinyl " : " ^2.2.0 "
4848 },
4949 "devDependencies" : {
50- "mocha" : " * "
50+ "mocha" : " ^5.2.0 "
5151 },
5252 "bugs" : {
5353 "url" : " https://github.com/shonny-ua/gulp-rev-outdated/issues"
Original file line number Diff line number Diff line change 11'use strict' ;
2- var assert = require ( 'assert' ) ;
3- var gutil = require ( 'gulp-util ' ) ;
2+ var assert = require ( 'assert' ) ;
3+ var Vinyl = require ( 'vinyl ' ) ;
44var revOutdated = require ( './index' ) ;
5- var path = require ( 'path' ) ;
5+ var path = require ( 'path' ) ;
66
77var assets = [
88 { path : 'css/style.css' , time : 0 } ,
@@ -127,9 +127,14 @@ it('should filter correct files', function (cb) {
127127
128128function initStream ( stream ) {
129129 assets . forEach ( function ( asset ) {
130- stream . write ( new gutil . File ( {
130+ var dateByTime = new Date ( asset . time ) ;
131+ stream . write ( new Vinyl ( {
131132 path : asset . path ,
132- stat : { ctime : new Date ( asset . time ) } ,
133+ stat : {
134+ ctime : dateByTime ,
135+ mtime : dateByTime ,
136+ atime : dateByTime
137+ } ,
133138 contents : new Buffer ( ' ' )
134139 } ) ) ;
135140 } ) ;
You can’t perform that action at this time.
0 commit comments