- fix conflicting order warning by mini-css-extract-plugin

This commit is contained in:
Amruth Pillai
2020-07-07 10:01:20 +05:30
parent 4e064dba96
commit d7e86ddf29
2 changed files with 20 additions and 8 deletions

12
gatsby-node.js Normal file
View File

@ -0,0 +1,12 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
if (stage === "build-javascript") {
const config = getConfig();
const index = config.plugins.findIndex((plugin) => {
return plugin.constructor.name === "MiniCssExtractPlugin";
});
config.plugins[index] = new MiniCssExtractPlugin({ ignoreOrder: true });
actions.replaceWebpackConfig(config);
}
};