@docusaurus/core 0.0.0-6042 → 0.0.0-6048
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.
- package/lib/commands/build.js +12 -5
- package/lib/webpack/base.js +1 -1
- package/lib/webpack/server.js +3 -1
- package/package.json +10 -10
package/lib/commands/build.js
CHANGED
|
@@ -125,8 +125,7 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
|
|
|
125
125
|
clientManifestPath,
|
|
126
126
|
router,
|
|
127
127
|
}));
|
|
128
|
-
|
|
129
|
-
await utils_3.PerfLogger.async('Deleting server bundle', () => ensureUnlink(serverBundlePath));
|
|
128
|
+
await cleanupServerBundle(serverBundlePath);
|
|
130
129
|
// Plugin Lifecycle - postBuild.
|
|
131
130
|
await utils_3.PerfLogger.async('postBuild()', () => executePluginsPostBuild({ plugins, props, collectedData }));
|
|
132
131
|
// TODO execute this in parallel to postBuild?
|
|
@@ -221,8 +220,16 @@ async function getBuildServerConfig({ props }) {
|
|
|
221
220
|
});
|
|
222
221
|
return { serverConfig: config, serverBundlePath: result.serverBundlePath };
|
|
223
222
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
// Remove /build/server server.bundle.js because it is not needed.
|
|
224
|
+
async function cleanupServerBundle(serverBundlePath) {
|
|
225
|
+
if (process.env.DOCUSAURUS_KEEP_SERVER_BUNDLE === 'true') {
|
|
226
|
+
logger_1.default.warn("Will NOT delete server bundle because DOCUSAURUS_KEEP_SERVER_BUNDLE is set to 'true'");
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
await utils_3.PerfLogger.async('Deleting server bundle', async () => {
|
|
230
|
+
// For now we assume server entry is at the root of the server out dir
|
|
231
|
+
const serverDir = path_1.default.dirname(serverBundlePath);
|
|
232
|
+
await fs_extra_1.default.rm(serverDir, { recursive: true, force: true });
|
|
233
|
+
});
|
|
227
234
|
}
|
|
228
235
|
}
|
package/lib/webpack/base.js
CHANGED
|
@@ -47,7 +47,7 @@ async function createBaseConfig({ props, isServer, minify, }) {
|
|
|
47
47
|
const totalPages = routesPaths.length;
|
|
48
48
|
const isProd = process.env.NODE_ENV === 'production';
|
|
49
49
|
const minimizeEnabled = minify && isProd;
|
|
50
|
-
const fileLoaderUtils = (0, utils_1.getFileLoaderUtils)();
|
|
50
|
+
const fileLoaderUtils = (0, utils_1.getFileLoaderUtils)(isServer);
|
|
51
51
|
const name = isServer ? 'server' : 'client';
|
|
52
52
|
const mode = isProd ? 'production' : 'development';
|
|
53
53
|
const themeAliases = await (0, aliases_1.loadThemeAliases)({ siteDir, plugins });
|
package/lib/webpack/server.js
CHANGED
|
@@ -22,13 +22,15 @@ async function createServerConfig(params) {
|
|
|
22
22
|
minify: false,
|
|
23
23
|
});
|
|
24
24
|
const outputFilename = 'server.bundle.js';
|
|
25
|
-
const
|
|
25
|
+
const outputDir = path_1.default.join(props.outDir, '__server');
|
|
26
|
+
const serverBundlePath = path_1.default.join(outputDir, outputFilename);
|
|
26
27
|
const config = (0, webpack_merge_1.default)(baseConfig, {
|
|
27
28
|
target: `node${utils_1.NODE_MAJOR_VERSION}.${utils_1.NODE_MINOR_VERSION}`,
|
|
28
29
|
entry: {
|
|
29
30
|
main: path_1.default.resolve(__dirname, '../client/serverEntry.js'),
|
|
30
31
|
},
|
|
31
32
|
output: {
|
|
33
|
+
path: outputDir,
|
|
32
34
|
filename: outputFilename,
|
|
33
35
|
libraryTarget: 'commonjs2',
|
|
34
36
|
// Workaround for Webpack 4 Bug (https://github.com/webpack/webpack/issues/6522)
|
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": "0.0.0-
|
|
4
|
+
"version": "0.0.0-6048",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@babel/runtime": "^7.22.6",
|
|
44
44
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
45
45
|
"@babel/traverse": "^7.22.8",
|
|
46
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
47
|
-
"@docusaurus/logger": "0.0.0-
|
|
48
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
49
|
-
"@docusaurus/utils": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
51
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
46
|
+
"@docusaurus/cssnano-preset": "0.0.0-6048",
|
|
47
|
+
"@docusaurus/logger": "0.0.0-6048",
|
|
48
|
+
"@docusaurus/mdx-loader": "0.0.0-6048",
|
|
49
|
+
"@docusaurus/utils": "0.0.0-6048",
|
|
50
|
+
"@docusaurus/utils-common": "0.0.0-6048",
|
|
51
|
+
"@docusaurus/utils-validation": "0.0.0-6048",
|
|
52
52
|
"autoprefixer": "^10.4.14",
|
|
53
53
|
"babel-loader": "^9.1.3",
|
|
54
54
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"webpackbar": "^5.0.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
107
|
-
"@docusaurus/types": "0.0.0-
|
|
106
|
+
"@docusaurus/module-type-aliases": "0.0.0-6048",
|
|
107
|
+
"@docusaurus/types": "0.0.0-6048",
|
|
108
108
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
109
109
|
"@types/detect-port": "^1.3.3",
|
|
110
110
|
"@types/react-dom": "^18.2.7",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"engines": {
|
|
126
126
|
"node": ">=18.0"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "482a5b8c84f0d0a2e834de99836937c3ccf52d4f"
|
|
129
129
|
}
|