diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index d238bcc7a8..f795aaa72d 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -45,7 +45,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp let result; if (prepareData.hmr) { - result = this.getUpdatedEmittedFiles(message.emittedFiles, message.webpackRuntimeFiles, message.entryPointFiles); + result = this.getUpdatedEmittedFiles(message.emittedFiles, message.chunkFiles); } else { result = { emittedFiles: message.emittedFiles, fallbackFiles: [], hash: "" }; } @@ -218,16 +218,13 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp return args; } - private getUpdatedEmittedFiles(emittedFiles: string[], webpackRuntimeFiles: string[], entryPointFiles: string[]) { + private getUpdatedEmittedFiles(emittedFiles: string[], chunkFiles: string[]) { let fallbackFiles: string[] = []; let hotHash; let result = emittedFiles.slice(); const hotUpdateScripts = emittedFiles.filter(x => x.endsWith('.hot-update.js')); - if (webpackRuntimeFiles && webpackRuntimeFiles.length) { - result = result.filter(file => webpackRuntimeFiles.indexOf(file) === -1); - } - if (entryPointFiles && entryPointFiles.length) { - result = result.filter(file => entryPointFiles.indexOf(file) === -1); + if (chunkFiles && chunkFiles.length) { + result = result.filter(file => chunkFiles.indexOf(file) === -1); } hotUpdateScripts.forEach(hotUpdateScript => { const { name, hash } = this.parseHotUpdateChunkName(hotUpdateScript); diff --git a/lib/services/webpack/webpack.d.ts b/lib/services/webpack/webpack.d.ts index 7f03b1b3c4..9f1b68e977 100644 --- a/lib/services/webpack/webpack.d.ts +++ b/lib/services/webpack/webpack.d.ts @@ -34,8 +34,7 @@ declare global { interface IWebpackEmitMessage { emittedFiles: string[]; - webpackRuntimeFiles: string[]; - entryPointFiles: string[]; + chunkFiles: string[]; } interface IPlatformProjectService extends NodeJS.EventEmitter, IPlatformProjectServiceBase {