Skip to content

Commit

Permalink
fix explicitIncludes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Reid committed Mar 19, 2017
1 parent 16c9208 commit dd6ea44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion css-modules-build-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class CssModulesBuildPlugin extends MultiFileCachingCompiler {
function addFilesFromIncludedFolders(files) {
pluginOptions.explicitIncludes.map(folderPath => {
const includedFiles = recursive(folderPath, [onlyAllowExtensionsHandledByPlugin]);
files = files.concat(includedFiles.map(filePath => new IncludedFile(filePath.replace(/\\/g, '/'), files[0])));
files = files.concat(includedFiles.map(filePath => { const file = new IncludedFile(filePath.replace(/\\/g, '/'), files[0]); Promise.await(file.prepInputFile(file)); return file;}));

function onlyAllowExtensionsHandledByPlugin(file, stats) {
let extension = path.extname(file);
Expand Down
1 change: 1 addition & 0 deletions included-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class IncludedFile {
file.contents = `${pluginOptions.globalVariablesText}\n\n${file.contents}`;
}
file.rawContents = file.contents;
file.isPrepped = true;
}

addJavaScript(options) {
Expand Down

0 comments on commit dd6ea44

Please sign in to comment.