@@ -3,7 +3,7 @@ import { BuildContext, BuildState, File, TaskInfo } from './util/interfaces';
3
3
import { BuildError , IgnorableError } from './util/errors' ;
4
4
import { changeExtension , readFileAsync , setContext } from './util/helpers' ;
5
5
import { emit , EventType } from './util/events' ;
6
- import { extname , join } from 'path' ;
6
+ import { join } from 'path' ;
7
7
import { fillConfigDefaults , generateContext , getUserConfigFile , replacePathVars } from './util/config' ;
8
8
import { Logger } from './logger/logger' ;
9
9
import * as webpackApi from 'webpack' ;
@@ -47,26 +47,11 @@ export function webpack(context: BuildContext, configFile: string) {
47
47
48
48
export function webpackUpdate ( event : string , path : string , context : BuildContext , configFile : string ) {
49
49
const logger = new Logger ( 'webpack update' ) ;
50
- const extension = extname ( path ) ;
51
-
52
50
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 ) => {
70
55
// the webpack incremental build finished, so reset the list of pending promises
71
56
pendingPromises = [ ] ;
72
57
Logger . debug ( 'webpackUpdate: Incremental Build Done, processing Data' ) ;
0 commit comments