File tree 3 files changed +36
-0
lines changed
3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 62
62
"dependencies" : {
63
63
"esprima" : " ^2.5.0" ,
64
64
"estraverse" : " ^4.1.0" ,
65
+ "gulp" : " ^3.9.0" ,
66
+ "gulp-util" : " ^3.0.6" ,
65
67
"jquery" : " ^2.1.4"
66
68
}
67
69
}
Original file line number Diff line number Diff line change
1
+ // LICENSE : MIT
2
+ "use strict" ;
3
+ import gulp from "gulp" ;
4
+ import { Transform } from "stream" ;
5
+ let transformStream = new Transform ( {
6
+ writableObjectMode : true ,
7
+ readableObjectMode : true ,
8
+ transform : function ( chunk , encoding , next ) {
9
+ let str = Buffer . concat ( [ Buffer ( "prefix" ) , chunk ] ) ;
10
+ this . push ( str ) ;
11
+ next ( ) ;
12
+ }
13
+ } ) ;
14
+
15
+ let gulpTransform = new Transform ( {
16
+ writableObjectMode : true ,
17
+ readableObjectMode : true ,
18
+ transform : function ( file , encoding , next ) {
19
+ if ( file . isStream ( ) ) {
20
+ file . contents = file . contents . pipe ( transformStream ) ;
21
+ }
22
+ this . push ( file ) ;
23
+ next ( ) ;
24
+ }
25
+ } ) ;
26
+ gulp . task ( "default" , function ( ) {
27
+ return gulp . src ( "./*.js" , { buffer : false } )
28
+ . pipe ( gulpTransform )
29
+ . pipe ( gulp . dest ( "modified-files" ) )
30
+ . on ( "error" , ( error ) => {
31
+ console . error ( error ) ;
32
+ } ) ;
33
+ } ) ;
Original file line number Diff line number Diff line change 67
67
specs :
68
68
- from : connect
69
69
to : Connect
70
+ - expected : gulp
70
71
71
72
- expected : プラグインアーキテクチャ
72
73
pattern :
You can’t perform that action at this time.
0 commit comments