Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/services/webpack/webpack-compiler-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'))) {
Expand All @@ -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);
Expand Down