@docusaurus/core 3.7.0-canary-6307 → 3.7.0-canary-6309

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.
@@ -21,6 +21,7 @@ const configure_1 = require("../../webpack/configure");
21
21
  const ssgExecutor_1 = require("../../ssg/ssgExecutor");
22
22
  const clearPath_1 = tslib_1.__importDefault(require("../utils/clearPath"));
23
23
  const SkipBundling = process.env.DOCUSAURUS_SKIP_BUNDLING === 'true';
24
+ const ExitAfterBundling = process.env.DOCUSAURUS_EXIT_AFTER_BUNDLING === 'true';
24
25
  async function buildLocale({ siteDir, locale, cliOptions, }) {
25
26
  // Temporary workaround to unlock the ability to translate the site config
26
27
  // We'll remove it if a better official API can be designed
@@ -58,6 +59,9 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
58
59
  console.warn(`Skipping the Docusaurus bundling step because DOCUSAURUS_SKIP_BUNDLING='true'`);
59
60
  }
60
61
  else {
62
+ const cleanupBundlerTracing = await (0, bundler_1.registerBundlerTracing)({
63
+ currentBundler: props.currentBundler,
64
+ });
61
65
  // Run webpack to build JS bundle (client) and static html files (server).
62
66
  await logger_1.PerfLogger.async(`Bundling with ${props.currentBundler.name}`, () => {
63
67
  return (0, bundler_1.compile)({
@@ -67,6 +71,10 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
67
71
  currentBundler: configureWebpackUtils.currentBundler,
68
72
  });
69
73
  });
74
+ await cleanupBundlerTracing();
75
+ }
76
+ if (ExitAfterBundling) {
77
+ return process.exit(0);
70
78
  }
71
79
  const { collectedData } = await logger_1.PerfLogger.async('SSG', () => (0, ssgExecutor_1.executeSSG)({
72
80
  props,
package/lib/ssg/ssgEnv.js CHANGED
@@ -33,7 +33,6 @@ exports.SSGWorkerThreadTaskSize = process.env
33
33
  exports.SSGWorkerThreadRecyclerMaxMemory = process.env
34
34
  .DOCUSAURUS_SSG_WORKER_THREAD_RECYCLER_MAX_MEMORY
35
35
  ? parseInt(process.env.DOCUSAURUS_SSG_WORKER_THREAD_RECYCLER_MAX_MEMORY, 10)
36
- : // TODO we should probably provide a default value here
37
- // 2gb is a quite reasonable max that should work well even for large sites
38
- // we'd rather ask community feedback first
39
- undefined;
36
+ : // 1 GB is a quite reasonable max value
37
+ // It should work well even for large sites
38
+ 1000000000;
@@ -193,6 +193,18 @@ async function createBaseConfig({ props, isServer, minify, faster, configureWebp
193
193
  modules: ['node_modules', path_1.default.join(siteDir, 'node_modules')],
194
194
  },
195
195
  optimization: {
196
+ // The optimizations.concatenateModules is expensive
197
+ // - On the server, it's not useful to run it at all
198
+ // - On the client, it leads to a ~3% JS assets total size decrease
199
+ // Let's keep it by default, but large sites may prefer faster builds
200
+ // See also https://github.com/facebook/docusaurus/pull/11176
201
+ concatenateModules: !isServer,
202
+ // The optimizations.mergeDuplicateChunks is expensive
203
+ // - On the server, it's not useful to run it at all
204
+ // - On the client, we compared assets/js before/after and see 0 change
205
+ // `du -sk js-before js-after` => the JS assets have the exact same size
206
+ // See also https://github.com/facebook/docusaurus/pull/11176
207
+ mergeDuplicateChunks: true,
196
208
  // Only minimize client bundle in production because server bundle is only
197
209
  // used for static site generation
198
210
  minimize: minimizeEnabled,
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": "3.7.0-canary-6307",
4
+ "version": "3.7.0-canary-6309",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -33,13 +33,13 @@
33
33
  "url": "https://github.com/facebook/docusaurus/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@docusaurus/babel": "3.7.0-canary-6307",
37
- "@docusaurus/bundler": "3.7.0-canary-6307",
38
- "@docusaurus/logger": "3.7.0-canary-6307",
39
- "@docusaurus/mdx-loader": "3.7.0-canary-6307",
40
- "@docusaurus/utils": "3.7.0-canary-6307",
41
- "@docusaurus/utils-common": "3.7.0-canary-6307",
42
- "@docusaurus/utils-validation": "3.7.0-canary-6307",
36
+ "@docusaurus/babel": "3.7.0-canary-6309",
37
+ "@docusaurus/bundler": "3.7.0-canary-6309",
38
+ "@docusaurus/logger": "3.7.0-canary-6309",
39
+ "@docusaurus/mdx-loader": "3.7.0-canary-6309",
40
+ "@docusaurus/utils": "3.7.0-canary-6309",
41
+ "@docusaurus/utils-common": "3.7.0-canary-6309",
42
+ "@docusaurus/utils-validation": "3.7.0-canary-6309",
43
43
  "boxen": "^6.2.1",
44
44
  "chalk": "^4.1.2",
45
45
  "chokidar": "^3.5.3",
@@ -77,8 +77,8 @@
77
77
  "webpack-merge": "^6.0.1"
78
78
  },
79
79
  "devDependencies": {
80
- "@docusaurus/module-type-aliases": "3.7.0-canary-6307",
81
- "@docusaurus/types": "3.7.0-canary-6307",
80
+ "@docusaurus/module-type-aliases": "3.7.0-canary-6309",
81
+ "@docusaurus/types": "3.7.0-canary-6309",
82
82
  "@total-typescript/shoehorn": "^0.1.2",
83
83
  "@types/detect-port": "^1.3.3",
84
84
  "@types/react-dom": "^18.2.7",
@@ -98,5 +98,5 @@
98
98
  "engines": {
99
99
  "node": ">=18.0"
100
100
  },
101
- "gitHead": "0e2754e95723df81393508b9014db164f2ab7f34"
101
+ "gitHead": "68ccd60bdccdf8943ea673778467cb63705b0d32"
102
102
  }