77 copyFiles ,
88 inlineResourcesForDirectory ,
99 sequenceTask ,
10- watchFiles ,
1110} from 'material2-build-tools' ;
1211import {
1312 cdkPackage ,
@@ -17,6 +16,7 @@ import {
1716 momentAdapterPackage ,
1817 examplesPackage ,
1918} from '../packages' ;
19+ import { watchFilesAndReload } from '../util/watch-files-reload' ;
2020
2121// These imports don't have any typings provided.
2222const firebaseTools = require ( 'firebase-tools' ) ;
@@ -56,7 +56,7 @@ task(':build:devapp:assets', copyTask(assetsGlob, outDir));
5656task ( ':build:devapp:scss' , ( ) => buildScssPipeline ( appDir ) . pipe ( dest ( outDir ) ) ) ;
5757task ( ':build:devapp:inline-resources' , ( ) => inlineResourcesForDirectory ( outDir ) ) ;
5858
59- task ( ':serve:devapp' , serverTask ( outDir , true ) ) ;
59+ task ( ':serve:devapp' , serverTask ( outDir ) ) ;
6060
6161task ( 'build:devapp' , sequenceTask (
6262 'cdk:build-no-bundles' ,
@@ -123,40 +123,41 @@ task('deploy:devapp', ['stage-deploy:devapp'], () => {
123123 */
124124
125125task ( ':watch:devapp' , ( ) => {
126- watchFiles ( join ( appDir , '**/*.ts' ) , [ ':build:devapp:ts' ] ) ;
127- watchFiles ( join ( appDir , '**/*.scss' ) , [ ':watch:devapp:rebuild-scss' ] ) ;
128- watchFiles ( join ( appDir , '**/*.html' ) , [ ':watch:devapp:rebuild-html' ] ) ;
126+ watchFilesAndReload ( join ( appDir , '**/*.ts' ) , [ ':build:devapp:ts' ] ) ;
127+ watchFilesAndReload ( join ( appDir , '**/*.scss' ) , [ ':watch:devapp:rebuild-scss' ] ) ;
128+ watchFilesAndReload ( join ( appDir , '**/*.html' ) , [ ':watch:devapp:rebuild-html' ] ) ;
129129
130130 // Custom watchers for all packages that are used inside of the dev-app. This is necessary
131131 // because we only want to build the changed package (using the build-no-bundles task).
132132
133133 // CDK package watchers.
134- watchFiles ( join ( cdkPackage . sourceDir , '**/*' ) , [ 'cdk:build-no-bundles' ] ) ;
134+ watchFilesAndReload ( join ( cdkPackage . sourceDir , '**/*' ) , [ 'cdk:build-no-bundles' ] ) ;
135135
136136 const materialCoreThemingGlob = join ( materialPackage . sourceDir , '**/core/theming/**/*.scss' ) ;
137137
138138 // Material package watchers.
139- watchFiles ( [
139+ watchFilesAndReload ( [
140140 join ( materialPackage . sourceDir , '**/!(*-theme.scss)' ) , `!${ materialCoreThemingGlob } `
141141 ] , [ 'material:build-no-bundles' ] ) ;
142- watchFiles ( [
142+ watchFilesAndReload ( [
143143 join ( materialPackage . sourceDir , '**/*-theme.scss' ) , materialCoreThemingGlob
144144 ] , [ ':build:devapp:scss' ] ) ;
145145
146146 // Moment adapter package watchers
147- watchFiles ( join ( momentAdapterPackage . sourceDir , '**/*' ) ,
147+ watchFilesAndReload ( join ( momentAdapterPackage . sourceDir , '**/*' ) ,
148148 [ 'material-moment-adapter:build-no-bundles' ] ) ;
149149
150150 // Material experimental package watchers
151- watchFiles ( join ( materialExperimentalPackage . sourceDir , '**/*' ) ,
151+ watchFilesAndReload ( join ( materialExperimentalPackage . sourceDir , '**/*' ) ,
152152 [ 'material-experimental:build-no-bundles' ] ) ;
153153
154154 // CDK experimental package watchers
155- watchFiles ( join ( cdkExperimentalPackage . sourceDir , '**/*' ) ,
155+ watchFilesAndReload ( join ( cdkExperimentalPackage . sourceDir , '**/*' ) ,
156156 [ 'cdk-experimental:build-no-bundles' ] ) ;
157157
158158 // Example package watchers.
159- watchFiles ( join ( examplesPackage . sourceDir , '**/*' ) , [ 'material-examples:build-no-bundles' ] ) ;
159+ watchFilesAndReload ( join ( examplesPackage . sourceDir , '**/*' ) ,
160+ [ 'material-examples:build-no-bundles' ] ) ;
160161} ) ;
161162
162163// Note that we need to rebuild the TS here, because the resource inlining
0 commit comments