Skip to content

Commit 2b6e210

Browse files
committed
Merge pull request #67 from css-modules/fix-plugins
Fix PostCSS Plugins bug
2 parents 4184fb3 + 67c7d3f commit 2b6e210

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ module.exports = function (browserify, options) {
101101
var jsonOutFilename = options.json || options.jsonOutput;
102102
var sourceKey = cssOutFilename;
103103

104-
var loader = loadersByFile[sourceKey];
105-
if (!loader) {
106-
loader = loadersByFile[sourceKey] = new FileSystemLoader(rootDir, plugins);
107-
}
108-
109104
// PostCSS plugins passed to FileSystemLoader
110105
var plugins = options.use || options.u;
111106
if (!plugins) {
@@ -147,6 +142,12 @@ module.exports = function (browserify, options) {
147142
return plugin;
148143
});
149144

145+
// get (or create) a loader for this entry file
146+
var loader = loadersByFile[sourceKey];
147+
if (!loader) {
148+
loader = loadersByFile[sourceKey] = new FileSystemLoader(rootDir, plugins);
149+
}
150+
150151
// the compiled CSS stream needs to be avalible to the transform,
151152
// but re-created on each bundle call.
152153
var compiledCssStream;

0 commit comments

Comments
 (0)