@@ -22,6 +22,7 @@ export * from '@microsoft/gulp-core-build-karma';
2222export * from '@microsoft/gulp-core-build-webpack' ;
2323export * from '@microsoft/gulp-core-build-serve' ;
2424
25+ // pre copy and post copy allows you to specify a map of dest: [sources] to copy from one place to another.
2526export const preCopy : CopyTask = new CopyTask ( ) ;
2627preCopy . name = 'pre-copy' ;
2728
@@ -34,30 +35,33 @@ const sourceMatch: string[] = [
3435] ;
3536
3637// Define default task groups.
37- let buildTasks : IExecutable = task ( 'build' , serial ( preCopy , sass , parallel ( tslint , typescript , text ) , postCopy ) ) ;
38- let bundleTasks : IExecutable = task ( 'bundle' , serial ( buildTasks , webpack ) ) ;
39- const postProcessSourceMaps : PostProcessSourceMaps = new PostProcessSourceMaps ( ) ;
40- const validateShrinkwrapTask : ValidateShrinkwrapTask = new ValidateShrinkwrapTask ( ) ;
41- const generateShrinkwrapTask : GenerateShrinkwrapTask = new GenerateShrinkwrapTask ( ) ;
38+ export const compileTsTasks : IExecutable = parallel ( typescript , text ) ;
39+ export const buildTasks : IExecutable = task ( 'build' , serial ( preCopy , sass , parallel ( compileTsTasks , text ) , postCopy ) ) ;
40+ export const bundleTasks : IExecutable = task ( 'bundle' , serial ( buildTasks , webpack ) ) ;
41+ export const testTasks : IExecutable = serial ( sass , compileTsTasks , karma ) ;
42+ export const defaultTasks : IExecutable = serial ( bundleTasks , karma ) ;
43+ export const postProcessSourceMapsTask : PostProcessSourceMaps = new PostProcessSourceMaps ( ) ;
44+ export const validateShrinkwrapTask : ValidateShrinkwrapTask = new ValidateShrinkwrapTask ( ) ;
45+ export const generateShrinkwrapTask : GenerateShrinkwrapTask = new GenerateShrinkwrapTask ( ) ;
4246
4347task ( 'validate-shrinkwrap' , validateShrinkwrapTask ) ;
4448task ( 'generate' , generateShrinkwrapTask ) ;
4549
46- task ( 'test' , serial ( sass , parallel ( typescript , text ) , karma ) ) ;
50+ task ( 'test' , serial ( sass , testTasks ) ) ;
4751
48- task ( 'test-watch' , watch ( sourceMatch , serial ( sass , parallel ( typescript , text ) , karma ) ) ) ;
52+ task ( 'test-watch' , watch ( sourceMatch , serial ( sass , compileTsTasks , karma ) ) ) ;
4953
5054// For watch scenarios like serve, make sure to exclude generated files from src (like *.scss.ts.)
5155task ( 'serve' ,
5256 serial (
5357 bundleTasks ,
5458 serve ,
55- postProcessSourceMaps as any , // tslint:disable-line:no-any
59+ postProcessSourceMapsTask ,
5660 watch (
57- sourceMatch , serial ( preCopy , sass , parallel ( typescript , text ) ,
58- postCopy , webpack , postProcessSourceMaps as any , reload ) // tslint:disable-line:no-any
61+ sourceMatch , serial ( preCopy , sass , compileTsTasks ,
62+ postCopy , webpack , postProcessSourceMapsTask , reload )
5963 )
6064 )
6165) ;
6266
63- task ( 'default' , serial ( bundleTasks , karma ) ) ;
67+ task ( 'default' , defaultTasks ) ;
0 commit comments