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

Commit

Permalink
fix(webpack): always use modules output from webpack to form default …
Browse files Browse the repository at this point in the history
…basis of where to look for sass files
  • Loading branch information
danbucholtz committed Oct 7, 2017
1 parent 0354831 commit c199ea4
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,22 @@ function webpackBuildComplete(stats: any, context: BuildContext, webpackConfig:

// set the module files used in this bundle
// this reference can be used elsewhere in the build (sass)
if (!context.isProd || !context.optimizeJs) {

const files: string[] = [];
stats.compilation.modules.forEach((webpackModule: any) => {
if (webpackModule.resource) {
files.push(webpackModule.resource);
} else if (webpackModule.context) {
files.push(webpackModule.context);
} else if (webpackModule.fileDependencies) {
webpackModule.fileDependencies.forEach((filePath: string) => {
files.push(filePath);
});
}
});
const files: string[] = [];
stats.compilation.modules.forEach((webpackModule: any) => {
if (webpackModule.resource) {
files.push(webpackModule.resource);
} else if (webpackModule.context) {
files.push(webpackModule.context);
} else if (webpackModule.fileDependencies) {
webpackModule.fileDependencies.forEach((filePath: string) => {
files.push(filePath);
});
}
});

const trimmedFiles = files.filter(file => file && file.length > 0);
const trimmedFiles = files.filter(file => file && file.length > 0);

context.moduleFiles = trimmedFiles;
}
context.moduleFiles = trimmedFiles;

return setBundledFiles(context);
}
Expand Down

0 comments on commit c199ea4

Please sign in to comment.