From f4aa473a7c062848cbbb310f283b2961f72c2ebe Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Jan 2022 17:51:30 +0100 Subject: [PATCH 1/3] revert css-loader to 5.x --- packages/docusaurus/package.json | 2 +- yarn.lock | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus/package.json b/packages/docusaurus/package.json index 0eaeb7285f04..58e5aa21192e 100644 --- a/packages/docusaurus/package.json +++ b/packages/docusaurus/package.json @@ -59,7 +59,7 @@ "commander": "^5.1.0", "copy-webpack-plugin": "^10.2.0", "core-js": "^3.18.0", - "css-loader": "^6.5.1", + "css-loader": "^5.2.7", "css-minimizer-webpack-plugin": "^3.3.1", "cssnano": "^5.0.8", "del": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index 49eea30ca28b..ca7816ea18f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6812,18 +6812,20 @@ css-declaration-sorter@^6.0.3: dependencies: timsort "^0.3.0" -css-loader@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.5.1.tgz#0c43d4fbe0d97f699c91e9818cb585759091d1b1" - integrity sha512-gEy2w9AnJNnD9Kuo4XAP9VflW/ujKoS9c/syO+uWMlm5igc7LysKzPXaDoR2vroROkSwsTS2tGr1yGGEbZOYZQ== +css-loader@^5.2.7: + version "5.2.7" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.7.tgz#9b9f111edf6fb2be5dc62525644cbc9c232064ae" + integrity sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg== dependencies: icss-utils "^5.1.0" + loader-utils "^2.0.0" postcss "^8.2.15" postcss-modules-extract-imports "^3.0.0" postcss-modules-local-by-default "^4.0.0" postcss-modules-scope "^3.0.0" postcss-modules-values "^4.0.0" postcss-value-parser "^4.1.0" + schema-utils "^3.0.0" semver "^7.3.5" css-minimizer-webpack-plugin@^3.3.1: From edf17f9e86f62615c05006d527996ed8bf27f455 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Jan 2022 18:16:27 +0100 Subject: [PATCH 2/3] use css-loader v6 --- packages/docusaurus/package.json | 2 +- packages/docusaurus/src/webpack/utils.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/package.json b/packages/docusaurus/package.json index 58e5aa21192e..0eaeb7285f04 100644 --- a/packages/docusaurus/package.json +++ b/packages/docusaurus/package.json @@ -59,7 +59,7 @@ "commander": "^5.1.0", "copy-webpack-plugin": "^10.2.0", "core-js": "^3.18.0", - "css-loader": "^5.2.7", + "css-loader": "^6.5.1", "css-minimizer-webpack-plugin": "^3.3.1", "cssnano": "^5.0.8", "del": "^6.0.0", diff --git a/packages/docusaurus/src/webpack/utils.ts b/packages/docusaurus/src/webpack/utils.ts index 4c8e22b80381..63fb0edf662a 100644 --- a/packages/docusaurus/src/webpack/utils.ts +++ b/packages/docusaurus/src/webpack/utils.ts @@ -36,10 +36,16 @@ import {memoize} from 'lodash'; // Utility method to get style loaders export function getStyleLoaders( isServer: boolean, - cssOptions: { + cssOptionsArg: { [key: string]: unknown; } = {}, ): RuleSetRule[] { + const cssOptions: {[key: string]: unknown} = { + // TODO turn esModule on later, see https://github.com/facebook/docusaurus/pull/6424 + esModule: false, + ...cssOptionsArg, + }; + if (isServer) { return cssOptions.modules ? [ From 9f20ec953462572139d5d3d79615f0e6f90481b7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Jan 2022 18:16:42 +0100 Subject: [PATCH 3/3] use css-loader v6 --- yarn.lock | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca7816ea18f7..49eea30ca28b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6812,20 +6812,18 @@ css-declaration-sorter@^6.0.3: dependencies: timsort "^0.3.0" -css-loader@^5.2.7: - version "5.2.7" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.7.tgz#9b9f111edf6fb2be5dc62525644cbc9c232064ae" - integrity sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg== +css-loader@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.5.1.tgz#0c43d4fbe0d97f699c91e9818cb585759091d1b1" + integrity sha512-gEy2w9AnJNnD9Kuo4XAP9VflW/ujKoS9c/syO+uWMlm5igc7LysKzPXaDoR2vroROkSwsTS2tGr1yGGEbZOYZQ== dependencies: icss-utils "^5.1.0" - loader-utils "^2.0.0" postcss "^8.2.15" postcss-modules-extract-imports "^3.0.0" postcss-modules-local-by-default "^4.0.0" postcss-modules-scope "^3.0.0" postcss-modules-values "^4.0.0" postcss-value-parser "^4.1.0" - schema-utils "^3.0.0" semver "^7.3.5" css-minimizer-webpack-plugin@^3.3.1: