@docusaurus/core 4.0.0-canary-6913 → 4.0.0-canary-6917

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/webpack/base.js +11 -4
  2. package/package.json +13 -13
@@ -20,6 +20,13 @@ const BundlerCPUProfilerPlugin_1 = require("./plugins/BundlerCPUProfilerPlugin")
20
20
  const CSS_REGEX = /\.css$/i;
21
21
  const CSS_MODULE_REGEX = /\.module\.css$/i;
22
22
  exports.clientDir = node_path_1.default.join(__dirname, '..', 'client');
23
+ // The RealContentHashPlugin replaces every occurrence of a provisional chunk
24
+ // hash in all assets, even inside unrelated hex strings (file-loader asset
25
+ // names, colors, numbers...). The client and server compilations do it
26
+ // independently, so a false positive can make the SSG HTML reference a missing
27
+ // file. 10 chars instead of 8 makes it ~256x less likely.
28
+ // See https://github.com/web-infra-dev/rspack/issues/8474
29
+ const contentHash = '[contenthash:10]';
23
30
  function getReactAliases(siteDir) {
24
31
  // Escape hatch
25
32
  if (process.env.DOCUSAURUS_NO_REACT_ALIASES) {
@@ -114,9 +121,9 @@ async function createBaseConfig({ props, isServer, minify, configureWebpackUtils
114
121
  output: {
115
122
  pathinfo: false,
116
123
  path: outDir,
117
- filename: isProd ? 'assets/js/[name].[contenthash:8].js' : '[name].js',
124
+ filename: isProd ? `assets/js/[name].${contentHash}.js` : '[name].js',
118
125
  chunkFilename: isProd
119
- ? 'assets/js/[name].[contenthash:8].js'
126
+ ? `assets/js/[name].${contentHash}.js`
120
127
  : '[name].js',
121
128
  publicPath: siteConfig.future.experimental_router === 'hash' ? 'auto' : baseUrl,
122
129
  hashFunction: 'xxhash64',
@@ -252,10 +259,10 @@ async function createBaseConfig({ props, isServer, minify, configureWebpackUtils
252
259
  plugins: [
253
260
  new CSSExtractPlugin({
254
261
  filename: isProd
255
- ? 'assets/css/[name].[contenthash:8].css'
262
+ ? `assets/css/[name].${contentHash}.css`
256
263
  : '[name].css',
257
264
  chunkFilename: isProd
258
- ? 'assets/css/[name].[contenthash:8].css'
265
+ ? `assets/css/[name].${contentHash}.css`
259
266
  : '[name].css',
260
267
  // Remove css order warnings if css imports are not sorted
261
268
  // alphabetically. See https://github.com/webpack-contrib/mini-css-extract-plugin/pull/422
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "4.0.0-canary-6913",
4
+ "version": "4.0.0-canary-6917",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -33,15 +33,15 @@
33
33
  "url": "https://github.com/facebook/docusaurus/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@docusaurus/babel": "4.0.0-canary-6913",
37
- "@docusaurus/bundler": "4.0.0-canary-6913",
38
- "@docusaurus/fs": "4.0.0-canary-6913",
39
- "@docusaurus/glob": "4.0.0-canary-6913",
40
- "@docusaurus/logger": "4.0.0-canary-6913",
41
- "@docusaurus/mdx-loader": "4.0.0-canary-6913",
42
- "@docusaurus/utils": "4.0.0-canary-6913",
43
- "@docusaurus/utils-common": "4.0.0-canary-6913",
44
- "@docusaurus/utils-validation": "4.0.0-canary-6913",
36
+ "@docusaurus/babel": "4.0.0-canary-6917",
37
+ "@docusaurus/bundler": "4.0.0-canary-6917",
38
+ "@docusaurus/fs": "4.0.0-canary-6917",
39
+ "@docusaurus/glob": "4.0.0-canary-6917",
40
+ "@docusaurus/logger": "4.0.0-canary-6917",
41
+ "@docusaurus/mdx-loader": "4.0.0-canary-6917",
42
+ "@docusaurus/utils": "4.0.0-canary-6917",
43
+ "@docusaurus/utils-common": "4.0.0-canary-6917",
44
+ "@docusaurus/utils-validation": "4.0.0-canary-6917",
45
45
  "@rspack/core": "^2.2.3",
46
46
  "@rspack/dev-server": "^2.2.1",
47
47
  "boxen": "^9.0.0",
@@ -74,8 +74,8 @@
74
74
  "webpack-merge": "^6.0.1"
75
75
  },
76
76
  "devDependencies": {
77
- "@docusaurus/module-type-aliases": "4.0.0-canary-6913",
78
- "@docusaurus/types": "4.0.0-canary-6913",
77
+ "@docusaurus/module-type-aliases": "4.0.0-canary-6917",
78
+ "@docusaurus/types": "4.0.0-canary-6917",
79
79
  "@total-typescript/shoehorn": "^0.1.2",
80
80
  "@types/escape-html": "^1.0.4",
81
81
  "@types/history": "^4.7.11",
@@ -96,5 +96,5 @@
96
96
  "engines": {
97
97
  "node": ">=24.21"
98
98
  },
99
- "gitHead": "4ac512f4ec13cf7626e2f099b8e076552a707b78"
99
+ "gitHead": "ee71afc5cacf13c6198155e64c4c7ab89c0d7eef"
100
100
  }