@@ -41,25 +41,25 @@ gulp.task('pl-copy:font', function(){
4141
4242// CSS Copy
4343gulp . task ( 'pl-copy:css' , function ( ) {
44- return gulp . src ( resolvePath ( paths ( ) . source . css , ' *.css') )
44+ return gulp . src ( resolvePath ( paths ( ) . source . css ) + '/ *.css')
4545 . pipe ( gulp . dest ( resolvePath ( paths ( ) . public . css ) ) )
4646 . pipe ( browserSync . stream ( ) ) ;
4747} ) ;
4848
4949// Styleguide Copy everything but css
5050gulp . task ( 'pl-copy:styleguide' , function ( ) {
51- return gulp . src ( resolvePath ( paths ( ) . source . styleguide , ' **/!(*.css)') )
51+ return gulp . src ( resolvePath ( paths ( ) . source . styleguide ) + '/ **/!(*.css)')
5252 . pipe ( gulp . dest ( resolvePath ( paths ( ) . public . root ) ) )
5353 . pipe ( browserSync . stream ( ) ) ;
5454} ) ;
5555
5656// Styleguide Copy and flatten css
5757gulp . task ( 'pl-copy:styleguide-css' , function ( ) {
58- return gulp . src ( resolvePath ( paths ( ) . source . styleguide , ' **/*.css') )
58+ return gulp . src ( resolvePath ( paths ( ) . source . styleguide ) + '/ **/*.css')
5959 . pipe ( gulp . dest ( function ( file ) {
6060 //flatten anything inside the styleguide into a single output dir per http://stackoverflow.com/a/34317320/1790362
6161 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' ) ) ;
6363 } ) )
6464 . pipe ( browserSync . stream ( ) ) ;
6565} ) ;
@@ -141,7 +141,7 @@ function getSupportedTemplateExtensions() {
141141}
142142function getTemplateWatches ( ) {
143143 return getSupportedTemplateExtensions ( ) . map ( function ( dotExtension ) {
144- return resolvePath ( paths ( ) . source . patterns , ' **/*' + dotExtension ) ;
144+ return resolvePath ( paths ( ) . source . patterns ) + '/ **/*' + dotExtension ;
145145 } ) ;
146146}
147147
@@ -154,19 +154,21 @@ function reloadCSS() {
154154}
155155
156156function 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 ) ) ;
159159
160160 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 ) + '/*'
168168 ] . concat ( getTemplateWatches ( ) ) ;
169169
170+ console . log ( patternWatches ) ;
171+
170172 gulp . watch ( patternWatches , { awaitWriteFinish : true } ) . on ( 'change' , gulp . series ( build , reload ) ) ;
171173}
172174
0 commit comments