diff --git a/gatsby-node.js b/gatsby-node.js new file mode 100644 index 00000000..a5df0ab0 --- /dev/null +++ b/gatsby-node.js @@ -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); + } +}; diff --git a/package-lock.json b/package-lock.json index 5d57aec0..256982b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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",