Is is possible to run two separate loader chains for the same extension?
In my case, I want to run one set of loaders to build a static file, and another to write a different set of files (for server side rendering)
{
test: /\.p?css$/,
use: ExtractTextPlugin.extract([ "css-loader", "postcss-loader" ]),
},
{
test: /\.p?css$/,
use: [
{
loader: "emit-file-loader",
options: {
name: "dist/[path][name].pcss",
},
},
{
loader: "skeleton-loader",
options: {
procedure: function (content) {
return `module.exports = ${content}`
},
},
},
"postcss-loader",
]),
}
But according to What is the loader order for webpack? it seems to run all loaders in the same chain, even if they're defined in separate rules.
Maybe I'm not understanding loaders fully, but is there a way to have each set of loaders (the use
list) run independently?