From 96c7cd73d74a8df173fa002450e28ed30637a5d6 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 5 Jun 2019 17:41:13 +0300 Subject: [PATCH] fix: handle correctly runtime files --- lib/services/webpack/webpack-compiler-service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 6f42ba8f7d..7870e2a36b 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -37,7 +37,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp return; } - const result = this.getUpdatedEmittedFiles(message.emittedFiles); + const result = this.getUpdatedEmittedFiles(message.emittedFiles, message.webpackRuntimeFiles); const files = result.emittedFiles .filter((file: string) => file.indexOf("App_Resources") === -1) @@ -173,7 +173,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp return args; } - private getUpdatedEmittedFiles(emittedFiles: string[]) { + private getUpdatedEmittedFiles(emittedFiles: string[], webpackRuntimeFiles: string[]) { let fallbackFiles: string[] = []; let hotHash; if (emittedFiles.some(x => x.endsWith('.hot-update.json'))) { @@ -184,6 +184,10 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp hotHash = hash; // remove bundle/vendor.js files if there's a bundle.XXX.hot-update.js or vendor.XXX.hot-update.js result = result.filter(file => file !== `${name}.js`); + if (webpackRuntimeFiles && webpackRuntimeFiles.length) { + // remove files containing only the Webpack runtime (e.g. runtime.js) + result = result.filter(file => webpackRuntimeFiles.indexOf(file) === -1); + } }); //if applying of hot update fails, we must fallback to the full files fallbackFiles = emittedFiles.filter(file => result.indexOf(file) === -1);