- 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);
}
};

16
package-lock.json generated
View File

@ -8808,6 +8808,14 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"webpack-merge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz",
"integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==",
"requires": {
"lodash": "^4.17.15"
}
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
@ -19706,14 +19714,6 @@
}
}
},
"webpack-merge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz",
"integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==",
"requires": {
"lodash": "^4.17.15"
}
},
"webpack-sources": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",