diff --git a/index.js b/index.js index 7505996..35113b0 100644 --- a/index.js +++ b/index.js @@ -101,11 +101,6 @@ module.exports = function (browserify, options) { var jsonOutFilename = options.json || options.jsonOutput; var sourceKey = cssOutFilename; - var loader = loadersByFile[sourceKey]; - if (!loader) { - loader = loadersByFile[sourceKey] = new FileSystemLoader(rootDir, plugins); - } - // PostCSS plugins passed to FileSystemLoader var plugins = options.use || options.u; if (!plugins) { @@ -147,6 +142,12 @@ module.exports = function (browserify, options) { return plugin; }); + // get (or create) a loader for this entry file + var loader = loadersByFile[sourceKey]; + if (!loader) { + loader = loadersByFile[sourceKey] = new FileSystemLoader(rootDir, plugins); + } + // the compiled CSS stream needs to be avalible to the transform, // but re-created on each bundle call. var compiledCssStream;