From dd6ea44142ed90117168d1936b69ed205e8ea7c3 Mon Sep 17 00:00:00 2001 From: Nathan Reid Date: Sat, 18 Mar 2017 21:28:50 -0500 Subject: [PATCH] fix explicitIncludes #92 --- css-modules-build-plugin.js | 2 +- included-file.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/css-modules-build-plugin.js b/css-modules-build-plugin.js index 3734698..519447a 100644 --- a/css-modules-build-plugin.js +++ b/css-modules-build-plugin.js @@ -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); diff --git a/included-file.js b/included-file.js index 275666f..9070639 100644 --- a/included-file.js +++ b/included-file.js @@ -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) {