Skip to content

Commit

Permalink
chore: upgrade Webpack to 5.95 and related deps (#10548)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Oct 3, 2024
1 parent 5de4832 commit 05f3c20
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 41 deletions.
2 changes: 1 addition & 1 deletion packages/docusaurus-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"terser-webpack-plugin": "^5.3.9",
"tslib": "^2.6.0",
"url-loader": "^4.1.1",
"webpack": "^5.88.1",
"webpack": "^5.95.0",
"webpackbar": "^6.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"clsx": "^2.0.0",
"core-js": "^3.31.1",
"tslib": "^2.6.0",
"webpack": "^5.88.1",
"webpack": "^5.95.0",
"webpack-merge": "^5.9.0",
"workbox-build": "^7.0.0",
"workbox-precaching": "^7.0.0",
Expand Down
23 changes: 9 additions & 14 deletions packages/docusaurus-plugin-pwa/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,15 @@ export default function pluginPWA(
configureWebpack(config, isServer, {currentBundler}) {
return {
plugins: [
new currentBundler.instance.EnvironmentPlugin(
// See https://github.com/facebook/docusaurus/pull/10455#issuecomment-2317593528
// See https://github.com/webpack/webpack/commit/adf2a6b7c6077fd806ea0e378c1450cccecc9ed0#r145989788
// @ts-expect-error: bad Webpack type?
{
PWA_DEBUG: debug,
PWA_SERVICE_WORKER_URL: path.posix.resolve(
`${(config.output?.publicPath as string) || '/'}`,
'sw.js',
),
PWA_OFFLINE_MODE_ACTIVATION_STRATEGIES:
offlineModeActivationStrategies,
},
),
new currentBundler.instance.EnvironmentPlugin({
PWA_DEBUG: debug,
PWA_SERVICE_WORKER_URL: path.posix.resolve(
`${(config.output?.publicPath as string) || '/'}`,
'sw.js',
),
PWA_OFFLINE_MODE_ACTIVATION_STRATEGIES:
offlineModeActivationStrategies,
}),
],
};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"joi": "^17.9.2",
"react-helmet-async": "^1.3.0",
"utility-types": "^3.10.0",
"webpack": "^5.88.1",
"webpack": "^5.95.0",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"shelljs": "^0.8.5",
"tslib": "^2.6.0",
"update-notifier": "^6.0.2",
"webpack": "^5.88.1",
"webpack-bundle-analyzer": "^4.9.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
"webpack": "^5.95.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-dev-server": "^4.15.2",
"webpack-merge": "^6.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.5.2",
Expand All @@ -88,7 +88,7 @@
"@types/rtl-detect": "^1.0.0",
"@types/serve-handler": "^6.1.4",
"@types/update-notifier": "^6.0.4",
"@types/webpack-bundle-analyzer": "^4.6.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
"react-test-renderer": "^18.0.0",
"tmp-promise": "^3.0.3",
"tree-node-cli": "^1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/webpack/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export async function createBuildClientConfig({
new ReactLoadableSSRAddon({
filename: clientManifestPath,
}),
].filter(<T>(x: T | undefined | false): x is T => Boolean(x)),
],
},
);

Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/webpack/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default async function createServerConfig({
name: 'Server',
color: 'yellow',
}),
].filter(Boolean),
],
});

return {config, serverBundlePath};
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"rehype-katex": "^7.0.0",
"remark-math": "^6.0.0",
"unist-util-visit": "^5.0.0",
"webpack": "^5.88.1",
"webpack": "^5.95.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0"
},
Expand Down
41 changes: 25 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3860,10 +3860,10 @@
"@types/configstore" "*"
boxen "^7.0.0"

"@types/webpack-bundle-analyzer@^4.6.0":
version "4.6.0"
resolved "https://registry.yarnpkg.com/@types/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.6.0.tgz#8863d62d2432126c2b3a9239cafa469215981c24"
integrity sha512-XeQmQCCXdZdap+A/60UKmxW5Mz31Vp9uieGlHB3T4z/o2OLVLtTI3bvTuS6A2OWd/rbAAQiGGWIEFQACu16szA==
"@types/webpack-bundle-analyzer@^4.7.0":
version "4.7.0"
resolved "https://registry.yarnpkg.com/@types/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.7.0.tgz#fe199e724ce3d38705f6f1ba4d62429b7c360541"
integrity sha512-c5i2ThslSNSG8W891BRvOd/RoCjI2zwph8maD22b1adtSns20j+0azDDMCK06DiVrzTgnwiDl5Ntmu1YRJw8Sg==
dependencies:
"@types/node" "*"
tapable "^2.2.0"
Expand Down Expand Up @@ -17117,7 +17117,7 @@ webidl-conversions@^7.0.0:
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a"
integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==

webpack-bundle-analyzer@^4.10.2, webpack-bundle-analyzer@^4.9.0:
webpack-bundle-analyzer@^4.10.2:
version "4.10.2"
resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz#633af2862c213730be3dbdf40456db171b60d5bd"
integrity sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==
Expand All @@ -17135,7 +17135,7 @@ webpack-bundle-analyzer@^4.10.2, webpack-bundle-analyzer@^4.9.0:
sirv "^2.0.3"
ws "^7.3.1"

webpack-dev-middleware@^5.3.1:
webpack-dev-middleware@^5.3.4:
version "5.3.4"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517"
integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==
Expand All @@ -17146,10 +17146,10 @@ webpack-dev-middleware@^5.3.1:
range-parser "^1.2.1"
schema-utils "^4.0.0"

webpack-dev-server@^4.15.1:
version "4.15.1"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz#8944b29c12760b3a45bdaa70799b17cb91b03df7"
integrity sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==
webpack-dev-server@^4.15.2:
version "4.15.2"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz#9e0c70a42a012560860adb186986da1248333173"
integrity sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==
dependencies:
"@types/bonjour" "^3.5.9"
"@types/connect-history-api-fallback" "^1.3.5"
Expand Down Expand Up @@ -17179,7 +17179,7 @@ webpack-dev-server@^4.15.1:
serve-index "^1.9.1"
sockjs "^0.3.24"
spdy "^4.0.2"
webpack-dev-middleware "^5.3.1"
webpack-dev-middleware "^5.3.4"
ws "^8.13.0"

webpack-merge@^5.9.0:
Expand All @@ -17190,15 +17190,24 @@ webpack-merge@^5.9.0:
clone-deep "^4.0.1"
wildcard "^2.0.0"

webpack-merge@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-6.0.1.tgz#50c776868e080574725abc5869bd6e4ef0a16c6a"
integrity sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==
dependencies:
clone-deep "^4.0.1"
flat "^5.0.2"
wildcard "^2.0.1"

webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==

webpack@^5, webpack@^5.88.1:
version "5.94.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f"
integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==
webpack@^5, webpack@^5.88.1, webpack@^5.95.0:
version "5.95.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.95.0.tgz#8fd8c454fa60dad186fbe36c400a55848307b4c0"
integrity sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==
dependencies:
"@types/estree" "^1.0.5"
"@webassemblyjs/ast" "^1.12.1"
Expand Down Expand Up @@ -17347,7 +17356,7 @@ widest-line@^4.0.1:
dependencies:
string-width "^5.0.1"

wildcard@^2.0.0:
wildcard@^2.0.0, wildcard@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67"
integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==
Expand Down

0 comments on commit 05f3c20

Please sign in to comment.