@@ -37,10 +37,9 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
37
37
return ;
38
38
}
39
39
40
- const result = this . getUpdatedEmittedFiles ( message . emittedFiles , message . webpackRuntimeFiles ) ;
40
+ const result = this . getUpdatedEmittedFiles ( message . emittedFiles , message . webpackRuntimeFiles , message . entryPointFiles ) ;
41
41
42
42
const files = result . emittedFiles
43
- . filter ( ( file : string ) => file . indexOf ( "App_Resources" ) === - 1 )
44
43
. map ( ( file : string ) => path . join ( platformData . appDestinationDirectoryPath , "app" , file ) ) ;
45
44
46
45
const data = {
@@ -173,23 +172,25 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
173
172
return args ;
174
173
}
175
174
176
- private getUpdatedEmittedFiles ( emittedFiles : string [ ] , webpackRuntimeFiles : string [ ] ) {
175
+ private getUpdatedEmittedFiles ( emittedFiles : string [ ] , webpackRuntimeFiles : string [ ] , entryPointFiles : string [ ] ) {
177
176
let fallbackFiles : string [ ] = [ ] ;
178
177
let hotHash ;
179
178
if ( emittedFiles . some ( x => x . endsWith ( '.hot-update.json' ) ) ) {
180
179
let result = emittedFiles . slice ( ) ;
181
180
const hotUpdateScripts = emittedFiles . filter ( x => x . endsWith ( '.hot-update.js' ) ) ;
181
+ if ( webpackRuntimeFiles && webpackRuntimeFiles . length ) {
182
+ result = result . filter ( file => webpackRuntimeFiles . indexOf ( file ) === - 1 ) ;
183
+ }
184
+ if ( entryPointFiles && entryPointFiles . length ) {
185
+ result = result . filter ( file => entryPointFiles . indexOf ( file ) === - 1 ) ;
186
+ }
182
187
hotUpdateScripts . forEach ( hotUpdateScript => {
183
188
const { name, hash } = this . parseHotUpdateChunkName ( hotUpdateScript ) ;
184
189
hotHash = hash ;
185
190
// remove bundle/vendor.js files if there's a bundle.XXX.hot-update.js or vendor.XXX.hot-update.js
186
191
result = result . filter ( file => file !== `${ name } .js` ) ;
187
- if ( webpackRuntimeFiles && webpackRuntimeFiles . length ) {
188
- // remove files containing only the Webpack runtime (e.g. runtime.js)
189
- result = result . filter ( file => webpackRuntimeFiles . indexOf ( file ) === - 1 ) ;
190
- }
191
192
} ) ;
192
- //if applying of hot update fails, we must fallback to the full files
193
+ // if applying of hot update fails, we must fallback to the full files
193
194
fallbackFiles = emittedFiles . filter ( file => result . indexOf ( file ) === - 1 ) ;
194
195
return { emittedFiles : result , fallbackFiles, hash : hotHash } ;
195
196
}
0 commit comments