@@ -17,13 +17,14 @@ let libName = 'tiny-slider',
17
17
modulePostfix = '.module' ,
18
18
helperIEPostfix = '.helper.ie8' ,
19
19
script = libName + '.js' ,
20
+ moduleScript = libName + modulePostfix + '.js' ,
20
21
helperIEScript = libName + helperIEPostfix + '.js' ,
21
22
testScript = testName + '.js' ,
22
23
sassFile = libName + '.scss' ,
23
24
pathSrc = 'src/' ,
24
25
pathDest = 'dist/' ,
25
26
pathTest = 'tests/js/' ,
26
- scriptSources = [ pathSrc + '**/*.js' , '!' + pathSrc + helperIEScript ] ;
27
+ scriptSources = [ pathSrc + '**/*.js' , '!' + pathSrc + moduleScript , '!' + pathSrc + helperIEScript ] ;
27
28
28
29
function errorlog ( error ) {
29
30
console . error . bind ( error ) ;
@@ -88,6 +89,17 @@ gulp.task('editPro', ['script'], function() {
88
89
. pipe ( gulp . dest ( pathDest ) )
89
90
} ) ;
90
91
92
+ gulp . task ( 'makeDevCopy' , function ( ) {
93
+ return gulp . src ( pathSrc + script )
94
+ // .pipe($.change(function (content) {
95
+ // return content
96
+ // .replace('IIFE', 'ES MODULE')
97
+ // .replace(/bower_components/g, '..');
98
+ // }))
99
+ . pipe ( $ . rename ( { basename : libName + modulePostfix } ) )
100
+ . pipe ( gulp . dest ( pathSrc ) )
101
+ } ) ;
102
+
91
103
gulp . task ( 'min' , [ 'editPro' ] , function ( ) {
92
104
return gulp . src ( pathDest + '*.js' )
93
105
. pipe ( $ . sourcemaps . init ( ) )
@@ -173,6 +185,7 @@ gulp.task('server', function() {
173
185
gulp . watch ( pathSrc + sassFile , function ( e ) {
174
186
sassTask ( pathSrc + sassFile , pathDest ) ;
175
187
} ) ;
188
+ gulp . watch ( pathSrc + script , [ 'makeDevCopy' ] ) ;
176
189
gulp . watch ( scriptSources , [ 'min' ] ) ;
177
190
gulp . watch ( pathSrc + helperIEScript , [ 'helper-ie8' ] ) ;
178
191
// gulp.watch([pathTest + testScript], ['test']);
@@ -184,6 +197,7 @@ gulp.task('default', [
184
197
// 'sass',
185
198
// 'min',
186
199
// 'helper-ie8',
200
+ // 'makeDevCopy',
187
201
// 'test',
188
202
'server' ,
189
203
] ) ;
0 commit comments