Search code examples
javascriptpostcss

PostCSS: ExtractTextPlugin run twice


I am trying to create a new postcss plugin. The problem is that when I am using the ExtractTextPlugin, the code is run twice, so if, for example, I'm appending new rule, it will append this twice.

I was looking for a solution and people are suggested to add allChunks: true, but it does not work.

css.walkRules(function (rule) {

    rule.walkDecls(function (decl, i) {

       // this is run twice with ExtractTextPlugin

    });

});

Solution

  • My solution was to just remove the fallback: "style-loader" from webpack.config file.