Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit c199ea4

Browse files
committed
fix(webpack): always use modules output from webpack to form default basis of where to look for sass files
1 parent 0354831 commit c199ea4

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

src/webpack.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,22 @@ function webpackBuildComplete(stats: any, context: BuildContext, webpackConfig:
9595

9696
// set the module files used in this bundle
9797
// 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+
});
112110

113-
const trimmedFiles = files.filter(file => file && file.length > 0);
111+
const trimmedFiles = files.filter(file => file && file.length > 0);
114112

115-
context.moduleFiles = trimmedFiles;
116-
}
113+
context.moduleFiles = trimmedFiles;
117114

118115
return setBundledFiles(context);
119116
}

0 commit comments

Comments
 (0)