File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 6262 "dependencies" : {
6363 "esprima" : " ^2.5.0" ,
6464 "estraverse" : " ^4.1.0" ,
65+ "gulp" : " ^3.9.0" ,
66+ "gulp-util" : " ^3.0.6" ,
6567 "jquery" : " ^2.1.4"
6668 }
6769}
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 6767 specs :
6868 - from : connect
6969 to : Connect
70+ - expected : gulp
7071
7172 - expected : プラグインアーキテクチャ
7273 pattern :
You can’t perform that action at this time.
0 commit comments