From e78d6718eeb5dcf70ec601c9cc342a3eebd33963 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 29 Dec 2024 12:10:22 +0000 Subject: [PATCH 1/4] add config for css conflict Signed-off-by: Shivam Gupta --- gatsby-node.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gatsby-node.js b/gatsby-node.js index c38e2531ceed..45fc9589eae8 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -977,7 +977,7 @@ const createSectionPage = ({ envCreatePage, node }) => { }); }; -exports.onCreateWebpackConfig = ({ actions }) => { +exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => { actions.setWebpackConfig({ resolve: { fallback: { @@ -987,7 +987,21 @@ exports.onCreateWebpackConfig = ({ actions }) => { }, }, }); + + if (stage === "build-javascript") { + const config = getConfig(); + const miniCssExtractPlugin = config.plugins.find( + (plugin) => plugin.constructor.name === "MiniCssExtractPlugin" + ); + + if (miniCssExtractPlugin) { + miniCssExtractPlugin.options.ignoreOrder = true; + } + + actions.replaceWebpackConfig(config); + } }; + exports.createSchemaCustomization = ({ actions }) => { const { createTypes } = actions; const typeDefs = ` From c18625e0e4b7e2bbd13341a6eee11071d10045e7 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 29 Dec 2024 12:18:29 +0000 Subject: [PATCH 2/4] upgrade version Signed-off-by: Shivam Gupta --- package-lock.json | 115 ++++++++++++++++++++++++---------------------- package.json | 1 + 2 files changed, 62 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index a31a9447b667..81b342ed7f05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,7 @@ "joi": "^17.10.2", "js-search": "^2.0.0", "lodash": "^4.17.21", + "mini-css-extract-plugin": "^2.9.2", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", "prism-react-renderer": "^2.0.6", @@ -15145,6 +15146,15 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/gatsby/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/gatsby/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -15338,6 +15348,45 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "node_modules/gatsby/node_modules/mini-css-extract-plugin": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", + "integrity": "sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==", + "license": "MIT", + "dependencies": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0", + "webpack-sources": "^1.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.4.0 || ^5.0.0" + } + }, + "node_modules/gatsby/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/gatsby/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -18639,68 +18688,23 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", - "integrity": "sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", + "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", + "license": "MIT", "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0", - "webpack-sources": "^1.1.0" + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" }, "engines": { - "node": ">= 10.13.0" + "node": ">= 12.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "^4.4.0 || ^5.0.0" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "webpack": "^5.0.0" } }, "node_modules/minimatch": { @@ -24176,7 +24180,8 @@ "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==" + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "license": "MIT" }, "node_modules/source-map": { "version": "0.5.7", @@ -26818,6 +26823,7 @@ "version": "1.4.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "license": "MIT", "dependencies": { "source-list-map": "^2.0.0", "source-map": "~0.6.1" @@ -26827,6 +26833,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 4441d0a99256..4983895153cc 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "joi": "^17.10.2", "js-search": "^2.0.0", "lodash": "^4.17.21", + "mini-css-extract-plugin": "^2.9.2", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", "prism-react-renderer": "^2.0.6", From 8176cf67dc8c83fa520d6fb665d753a0ee31704d Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 29 Dec 2024 20:29:32 +0000 Subject: [PATCH 3/4] fix ordering Signed-off-by: Shivam Gupta --- gatsby-config.js | 1 + gatsby-node.js | 9 +++++++++ package-lock.json | 7 +++++++ package.json | 1 + 4 files changed, 18 insertions(+) diff --git a/gatsby-config.js b/gatsby-config.js index f52a4b0a6082..8d31291967ea 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -17,6 +17,7 @@ module.exports = { }, trailingSlash: "never", plugins: [ + "@mediacurrent/gatsby-plugin-silence-css-order-warning", { resolve: "gatsby-plugin-webpack-bundle-analyser-v2", options: { diff --git a/gatsby-node.js b/gatsby-node.js index 45fc9589eae8..7f8a6cb95605 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -9,6 +9,7 @@ const path = require("path"); const slugify = require("./src/utils/slugify"); const { paginate } = require("gatsby-awesome-pagination"); const { createFilePath } = require("gatsby-source-filesystem"); +const FilterWarningsPlugin = require("webpack-filter-warnings-plugin"); const config = require("./gatsby-config"); const { componentsData, @@ -987,6 +988,14 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => { }, }, }); + actions.setWebpackConfig({ + plugins: [ + new FilterWarningsPlugin({ + exclude: + /mini-css-extract-plugin[^]*Conflicting order. Following module has been added:/, + }), + ], + }); if (stage === "build-javascript") { const config = getConfig(); diff --git a/package-lock.json b/package-lock.json index 81b342ed7f05..2b2ae085e6ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@loadable/component": "^5.16.4", "@mdx-js/mdx": "1.6.22", "@mdx-js/react": "1.6.22", + "@mediacurrent/gatsby-plugin-silence-css-order-warning": "^1.0.0", "@mui/icons-material": "^5.16.4", "@mui/material": "^5.15.11", "@react-icons/all-files": "^4.1.0", @@ -3842,6 +3843,12 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/@mediacurrent/gatsby-plugin-silence-css-order-warning": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mediacurrent/gatsby-plugin-silence-css-order-warning/-/gatsby-plugin-silence-css-order-warning-1.0.0.tgz", + "integrity": "sha512-TiBIncOzH5JtjHxZ43D4KmsZcjaKaGtl4p9+9HbhdDSNC5DcS3KpIJWT0nS0qnSd2QlbDRx44XAkrl4GZpIwTA==", + "license": "MIT" + }, "node_modules/@mischnic/json-sourcemap": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@mischnic/json-sourcemap/-/json-sourcemap-0.1.1.tgz", diff --git a/package.json b/package.json index 4983895153cc..3ccd5a10818d 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@loadable/component": "^5.16.4", "@mdx-js/mdx": "1.6.22", "@mdx-js/react": "1.6.22", + "@mediacurrent/gatsby-plugin-silence-css-order-warning": "^1.0.0", "@mui/icons-material": "^5.16.4", "@mui/material": "^5.15.11", "@react-icons/all-files": "^4.1.0", From 9b9d2c91c23d6008d94681d78eb0a3f70dc26e77 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 29 Dec 2024 20:33:08 +0000 Subject: [PATCH 4/4] add package Signed-off-by: Shivam Gupta --- package-lock.json | 13 +++++++++++++ package.json | 1 + 2 files changed, 14 insertions(+) diff --git a/package-lock.json b/package-lock.json index 2b2ae085e6ac..8cddd83bd0ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,6 +97,7 @@ "styled-components": "^6.0.5", "swiper": "^10.0.4", "url": "^0.11.3", + "webpack-filter-warnings-plugin": "^1.2.1", "xstate": "^5.13.0" }, "devDependencies": { @@ -26813,6 +26814,18 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/webpack-filter-warnings-plugin": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/webpack-filter-warnings-plugin/-/webpack-filter-warnings-plugin-1.2.1.tgz", + "integrity": "sha512-Ez6ytc9IseDMLPo0qCuNNYzgtUl8NovOqjIq4uAU8LTD4uoa1w1KpZyyzFtLTEMZpkkOkLfL9eN+KGYdk1Qtwg==", + "license": "MIT", + "engines": { + "node": ">= 4.3 < 5.0.0 || >= 5.10" + }, + "peerDependencies": { + "webpack": "^2.0.0 || ^3.0.0 || ^4.0.0" + } + }, "node_modules/webpack-merge": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", diff --git a/package.json b/package.json index 3ccd5a10818d..6ef285110ca2 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,7 @@ "styled-components": "^6.0.5", "swiper": "^10.0.4", "url": "^0.11.3", + "webpack-filter-warnings-plugin": "^1.2.1", "xstate": "^5.13.0" }, "devDependencies": {