@@ -3,7 +3,7 @@ import { BuildContext, BuildState, File, TaskInfo } from './util/interfaces';
33import { BuildError , IgnorableError } from './util/errors' ;
44import { changeExtension , readFileAsync , setContext } from './util/helpers' ;
55import { emit , EventType } from './util/events' ;
6- import { extname , join } from 'path' ;
6+ import { join } from 'path' ;
77import { fillConfigDefaults , generateContext , getUserConfigFile , replacePathVars } from './util/config' ;
88import { Logger } from './logger/logger' ;
99import * as webpackApi from 'webpack' ;
@@ -47,26 +47,11 @@ export function webpack(context: BuildContext, configFile: string) {
4747
4848export function webpackUpdate ( event : string , path : string , context : BuildContext , configFile : string ) {
4949 const logger = new Logger ( 'webpack update' ) ;
50- const extension = extname ( path ) ;
51-
5250 const webpackConfig = getWebpackConfig ( context , configFile ) ;
53- return Promise . resolve ( ) . then ( ( ) => {
54- if ( extension === '.ts' ) {
55- Logger . debug ( 'webpackUpdate: Typescript File Changed' ) ;
56- return typescriptFileChanged ( path , context . fileCache ) ;
57- } else {
58- Logger . debug ( 'webpackUpdate: Non-Typescript File Changed' ) ;
59- return otherFileChanged ( path ) . then ( ( file : File ) => {
60- return [ file ] ;
61- } ) ;
62- }
63- } )
64- . then ( ( files : File [ ] ) => {
65- Logger . debug ( 'webpackUpdate: Starting Incremental Build' ) ;
66- const promisetoReturn = runWebpackIncrementalBuild ( false , context , webpackConfig ) ;
67- emit ( EventType . WebpackFilesChanged , [ path ] ) ;
68- return promisetoReturn ;
69- } ) . then ( ( stats : any ) => {
51+ Logger . debug ( 'webpackUpdate: Starting Incremental Build' ) ;
52+ const promisetoReturn = runWebpackIncrementalBuild ( false , context , webpackConfig ) ;
53+ emit ( EventType . WebpackFilesChanged , [ path ] ) ;
54+ return promisetoReturn . then ( ( stats : any ) => {
7055 // the webpack incremental build finished, so reset the list of pending promises
7156 pendingPromises = [ ] ;
7257 Logger . debug ( 'webpackUpdate: Incremental Build Done, processing Data' ) ;
0 commit comments