@@ -95,25 +95,22 @@ function webpackBuildComplete(stats: any, context: BuildContext, webpackConfig:
95
95
96
96
// set the module files used in this bundle
97
97
// this reference can be used elsewhere in the build (sass)
98
- if ( ! context . isProd || ! context . optimizeJs ) {
99
-
100
- const files : string [ ] = [ ] ;
101
- stats . compilation . modules . forEach ( ( webpackModule : any ) => {
102
- if ( webpackModule . resource ) {
103
- files . push ( webpackModule . resource ) ;
104
- } else if ( webpackModule . context ) {
105
- files . push ( webpackModule . context ) ;
106
- } else if ( webpackModule . fileDependencies ) {
107
- webpackModule . fileDependencies . forEach ( ( filePath : string ) => {
108
- files . push ( filePath ) ;
109
- } ) ;
110
- }
111
- } ) ;
98
+ const files : string [ ] = [ ] ;
99
+ stats . compilation . modules . forEach ( ( webpackModule : any ) => {
100
+ if ( webpackModule . resource ) {
101
+ files . push ( webpackModule . resource ) ;
102
+ } else if ( webpackModule . context ) {
103
+ files . push ( webpackModule . context ) ;
104
+ } else if ( webpackModule . fileDependencies ) {
105
+ webpackModule . fileDependencies . forEach ( ( filePath : string ) => {
106
+ files . push ( filePath ) ;
107
+ } ) ;
108
+ }
109
+ } ) ;
112
110
113
- const trimmedFiles = files . filter ( file => file && file . length > 0 ) ;
111
+ const trimmedFiles = files . filter ( file => file && file . length > 0 ) ;
114
112
115
- context . moduleFiles = trimmedFiles ;
116
- }
113
+ context . moduleFiles = trimmedFiles ;
117
114
118
115
return setBundledFiles ( context ) ;
119
116
}
0 commit comments