@docusaurus/core 3.8.0 → 3.8.1
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 ExitAfterLoading = process.env.DOCUSAURUS_EXIT_AFTER_LOADING === 'true';
|
|
24
25
|
const ExitAfterBundling = process.env.DOCUSAURUS_EXIT_AFTER_BUNDLING === 'true';
|
|
25
26
|
async function buildLocale({ siteDir, locale, cliOptions, }) {
|
|
26
27
|
// Temporary workaround to unlock the ability to translate the site config
|
|
@@ -35,6 +36,9 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
|
|
|
35
36
|
locale,
|
|
36
37
|
localizePath: cliOptions.locale?.length === 1 ? false : undefined,
|
|
37
38
|
}));
|
|
39
|
+
if (ExitAfterLoading) {
|
|
40
|
+
return process.exit(0);
|
|
41
|
+
}
|
|
38
42
|
const { props } = site;
|
|
39
43
|
const { outDir, plugins, siteConfig } = props;
|
|
40
44
|
const router = siteConfig.future.experimental_router;
|
|
@@ -47,10 +47,17 @@ async function tryOpenWithAppleScript({ url, browser, }) {
|
|
|
47
47
|
'Brave Browser',
|
|
48
48
|
'Vivaldi',
|
|
49
49
|
'Chromium',
|
|
50
|
+
'Arc',
|
|
50
51
|
];
|
|
51
52
|
// Among all the supported browsers, retrieves to stdout the active ones
|
|
52
53
|
const command = `ps cax -o command | grep -E "^(${supportedChromiumBrowsers.join('|')})$"`;
|
|
53
|
-
const result = await execPromise(command)
|
|
54
|
+
const result = await execPromise(command).catch(() => {
|
|
55
|
+
// Ignore grep errors when macOS user has no Chromium-based browser open
|
|
56
|
+
// See https://github.com/facebook/docusaurus/issues/11204
|
|
57
|
+
});
|
|
58
|
+
if (!result) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
54
61
|
const activeBrowsers = result.stdout.toString().trim().split('\n');
|
|
55
62
|
// This preserves the initial browser order
|
|
56
63
|
// We open Google Chrome Canary in priority over Google Chrome
|
package/lib/webpack/base.js
CHANGED
|
@@ -196,12 +196,6 @@ async function createBaseConfig({ props, isServer, minify, faster, configureWebp
|
|
|
196
196
|
modules: ['node_modules', path_1.default.join(siteDir, 'node_modules')],
|
|
197
197
|
},
|
|
198
198
|
optimization: {
|
|
199
|
-
// The optimization.concatenateModules is expensive
|
|
200
|
-
// - On the server, it's not useful to run it at all
|
|
201
|
-
// - On the client, it leads to a ~3% JS assets total size decrease
|
|
202
|
-
// Let's keep it by default, but large sites may prefer faster builds
|
|
203
|
-
// See also https://github.com/facebook/docusaurus/pull/11176
|
|
204
|
-
concatenateModules: !isServer,
|
|
205
199
|
// The optimization.mergeDuplicateChunks is expensive
|
|
206
200
|
// - On the server, it's not useful to run it at all
|
|
207
201
|
// - On the client, we compared assets/js before/after and see 0 change
|
package/lib/webpack/server.js
CHANGED
|
@@ -43,6 +43,16 @@ async function createServerConfig({ props, configureWebpackUtils, }) {
|
|
|
43
43
|
color: 'yellow',
|
|
44
44
|
}),
|
|
45
45
|
],
|
|
46
|
+
optimization: {
|
|
47
|
+
// The optimization.concatenateModules is expensive
|
|
48
|
+
// - On the server, it's not useful to run it at all
|
|
49
|
+
// - On the client, it leads to a ~3% JS assets total size decrease
|
|
50
|
+
// Let's keep it by default, but large sites may prefer faster builds
|
|
51
|
+
// See also https://github.com/facebook/docusaurus/pull/11176
|
|
52
|
+
// Note: we don't want to enable it on the client for "docusaurus start"
|
|
53
|
+
// See also https://github.com/facebook/docusaurus/pull/11222
|
|
54
|
+
concatenateModules: false,
|
|
55
|
+
},
|
|
46
56
|
});
|
|
47
57
|
return { config, serverBundlePath };
|
|
48
58
|
}
|
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.8.
|
|
4
|
+
"version": "3.8.1",
|
|
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.8.
|
|
37
|
-
"@docusaurus/bundler": "3.8.
|
|
38
|
-
"@docusaurus/logger": "3.8.
|
|
39
|
-
"@docusaurus/mdx-loader": "3.8.
|
|
40
|
-
"@docusaurus/utils": "3.8.
|
|
41
|
-
"@docusaurus/utils-common": "3.8.
|
|
42
|
-
"@docusaurus/utils-validation": "3.8.
|
|
36
|
+
"@docusaurus/babel": "3.8.1",
|
|
37
|
+
"@docusaurus/bundler": "3.8.1",
|
|
38
|
+
"@docusaurus/logger": "3.8.1",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.8.1",
|
|
40
|
+
"@docusaurus/utils": "3.8.1",
|
|
41
|
+
"@docusaurus/utils-common": "3.8.1",
|
|
42
|
+
"@docusaurus/utils-validation": "3.8.1",
|
|
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.8.
|
|
81
|
-
"@docusaurus/types": "3.8.
|
|
80
|
+
"@docusaurus/module-type-aliases": "3.8.1",
|
|
81
|
+
"@docusaurus/types": "3.8.1",
|
|
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": "
|
|
101
|
+
"gitHead": "fa8ae13e668fcbc0481ce10c0a734e2a5b397293"
|
|
102
102
|
}
|