@@ -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 = {
@@ -178,23 +177,25 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
178
177
return args ;
179
178
}
180
179
181
- private getUpdatedEmittedFiles ( emittedFiles : string [ ] , webpackRuntimeFiles : string [ ] ) {
180
+ private getUpdatedEmittedFiles ( emittedFiles : string [ ] , webpackRuntimeFiles : string [ ] , entryPointFiles : string [ ] ) {
182
181
let fallbackFiles : string [ ] = [ ] ;
183
182
let hotHash ;
184
183
if ( emittedFiles . some ( x => x . endsWith ( '.hot-update.json' ) ) ) {
185
184
let result = emittedFiles . slice ( ) ;
186
185
const hotUpdateScripts = emittedFiles . filter ( x => x . endsWith ( '.hot-update.js' ) ) ;
186
+ if ( webpackRuntimeFiles && webpackRuntimeFiles . length ) {
187
+ result = result . filter ( file => webpackRuntimeFiles . indexOf ( file ) === - 1 ) ;
188
+ }
189
+ if ( entryPointFiles && entryPointFiles . length ) {
190
+ result = result . filter ( file => entryPointFiles . indexOf ( file ) === - 1 ) ;
191
+ }
187
192
hotUpdateScripts . forEach ( hotUpdateScript => {
188
193
const { name, hash } = this . parseHotUpdateChunkName ( hotUpdateScript ) ;
189
194
hotHash = hash ;
190
195
// remove bundle/vendor.js files if there's a bundle.XXX.hot-update.js or vendor.XXX.hot-update.js
191
196
result = result . filter ( file => file !== `${ name } .js` ) ;
192
- if ( webpackRuntimeFiles && webpackRuntimeFiles . length ) {
193
- // remove files containing only the Webpack runtime (e.g. runtime.js)
194
- result = result . filter ( file => webpackRuntimeFiles . indexOf ( file ) === - 1 ) ;
195
- }
196
197
} ) ;
197
- //if applying of hot update fails, we must fallback to the full files
198
+ // if applying of hot update fails, we must fallback to the full files
198
199
fallbackFiles = emittedFiles . filter ( file => result . indexOf ( file ) === - 1 ) ;
199
200
return { emittedFiles : result , fallbackFiles, hash : hotHash } ;
200
201
}
0 commit comments