@@ -41,25 +41,25 @@ gulp.task('pl-copy:font', function(){
41
41
42
42
// CSS Copy
43
43
gulp . task ( 'pl-copy:css' , function ( ) {
44
- return gulp . src ( resolvePath ( paths ( ) . source . css , ' *.css') )
44
+ return gulp . src ( resolvePath ( paths ( ) . source . css ) + '/ *.css')
45
45
. pipe ( gulp . dest ( resolvePath ( paths ( ) . public . css ) ) )
46
46
. pipe ( browserSync . stream ( ) ) ;
47
47
} ) ;
48
48
49
49
// Styleguide Copy everything but css
50
50
gulp . task ( 'pl-copy:styleguide' , function ( ) {
51
- return gulp . src ( resolvePath ( paths ( ) . source . styleguide , ' **/!(*.css)') )
51
+ return gulp . src ( resolvePath ( paths ( ) . source . styleguide ) + '/ **/!(*.css)')
52
52
. pipe ( gulp . dest ( resolvePath ( paths ( ) . public . root ) ) )
53
53
. pipe ( browserSync . stream ( ) ) ;
54
54
} ) ;
55
55
56
56
// Styleguide Copy and flatten css
57
57
gulp . task ( 'pl-copy:styleguide-css' , function ( ) {
58
- return gulp . src ( resolvePath ( paths ( ) . source . styleguide , ' **/*.css') )
58
+ return gulp . src ( resolvePath ( paths ( ) . source . styleguide ) + '/ **/*.css')
59
59
. pipe ( gulp . dest ( function ( file ) {
60
60
//flatten anything inside the styleguide into a single output dir per http://stackoverflow.com/a/34317320/1790362
61
61
file . path = path . join ( file . base , path . basename ( file . path ) ) ;
62
- return resolvePath ( path . join ( paths ( ) . public . styleguide , 'css' ) ) ;
62
+ return resolvePath ( path . join ( paths ( ) . public . styleguide , '/ css' ) ) ;
63
63
} ) )
64
64
. pipe ( browserSync . stream ( ) ) ;
65
65
} ) ;
@@ -141,7 +141,7 @@ function getSupportedTemplateExtensions() {
141
141
}
142
142
function getTemplateWatches ( ) {
143
143
return getSupportedTemplateExtensions ( ) . map ( function ( dotExtension ) {
144
- return resolvePath ( paths ( ) . source . patterns , ' **/*' + dotExtension ) ;
144
+ return resolvePath ( paths ( ) . source . patterns ) + '/ **/*' + dotExtension ;
145
145
} ) ;
146
146
}
147
147
@@ -154,19 +154,21 @@ function reloadCSS() {
154
154
}
155
155
156
156
function watch ( ) {
157
- gulp . watch ( resolvePath ( paths ( ) . source . css , ' **/*.css') , { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( 'pl-copy:css' , reloadCSS ) ) ;
158
- gulp . watch ( resolvePath ( paths ( ) . source . styleguide , ' **/*.*') , { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( 'pl-copy:styleguide' , 'pl-copy:styleguide-css' , reloadCSS ) ) ;
157
+ gulp . watch ( resolvePath ( paths ( ) . source . css ) + '/ **/*.css', { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( 'pl-copy:css' , reloadCSS ) ) ;
158
+ gulp . watch ( resolvePath ( paths ( ) . source . styleguide ) + '/ **/*.*', { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( 'pl-copy:styleguide' , 'pl-copy:styleguide-css' , reloadCSS ) ) ;
159
159
160
160
var patternWatches = [
161
- resolvePath ( paths ( ) . source . patterns , ' **/*.json') ,
162
- resolvePath ( paths ( ) . source . patterns , ' **/*.md') ,
163
- resolvePath ( paths ( ) . source . data , ' *.json') ,
164
- resolvePath ( paths ( ) . source . fonts + '/*' ) ,
165
- resolvePath ( paths ( ) . source . images + '/*' ) ,
166
- resolvePath ( paths ( ) . source . meta , '*' ) ,
167
- resolvePath ( paths ( ) . source . annotations + '/*' )
161
+ resolvePath ( paths ( ) . source . patterns ) + '/ **/*.json',
162
+ resolvePath ( paths ( ) . source . patterns ) + '/ **/*.md',
163
+ resolvePath ( paths ( ) . source . data ) + '/ *.json',
164
+ resolvePath ( paths ( ) . source . fonts ) + '/*' ,
165
+ resolvePath ( paths ( ) . source . images ) + '/*' ,
166
+ resolvePath ( paths ( ) . source . meta ) + '/*' ,
167
+ resolvePath ( paths ( ) . source . annotations ) + '/*'
168
168
] . concat ( getTemplateWatches ( ) ) ;
169
169
170
+ console . log ( patternWatches ) ;
171
+
170
172
gulp . watch ( patternWatches , { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( build , reload ) ) ;
171
173
}
172
174
0 commit comments