@docusaurus/core 0.0.0-6100 → 0.0.0-6101

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.
@@ -101,7 +101,7 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
101
101
  const router = siteConfig.future.experimental_router;
102
102
  const configureWebpackUtils = await (0, configure_1.createConfigureWebpackUtils)({ siteConfig });
103
103
  // We can build the 2 configs in parallel
104
- const [{ clientConfig, clientManifestPath }, { serverConfig, serverBundlePath }] = await logger_1.PerfLogger.async('Creating bundler configs', () => Promise.all([
104
+ const [{ clientConfig, clientManifestPath }, { serverConfig, serverBundlePath }] = await logger_1.PerfLogger.async(`Creating ${props.currentBundler.name} bundler configs`, () => Promise.all([
105
105
  getBuildClientConfig({
106
106
  props,
107
107
  cliOptions,
@@ -113,7 +113,7 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
113
113
  }),
114
114
  ]));
115
115
  // Run webpack to build JS bundle (client) and static html files (server).
116
- await logger_1.PerfLogger.async(`Bundling with ${configureWebpackUtils.currentBundler.name}`, () => {
116
+ await logger_1.PerfLogger.async(`Bundling with ${props.currentBundler.name}`, () => {
117
117
  return (0, bundler_1.compile)({
118
118
  configs:
119
119
  // For hash router we don't do SSG and can skip the server bundle
@@ -10,7 +10,6 @@ exports.createWebpackDevServer = createWebpackDevServer;
10
10
  const tslib_1 = require("tslib");
11
11
  const path_1 = tslib_1.__importDefault(require("path"));
12
12
  const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
13
- const webpack_1 = tslib_1.__importDefault(require("webpack"));
14
13
  const bundler_1 = require("@docusaurus/bundler");
15
14
  const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
16
15
  const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
@@ -125,7 +124,7 @@ async function createWebpackDevServer({ props, cliOptions, openUrlContext, }) {
125
124
  poll: cliOptions.poll,
126
125
  configureWebpackUtils,
127
126
  });
128
- const compiler = (0, webpack_1.default)(config);
127
+ const compiler = props.currentBundler.instance(config);
129
128
  registerWebpackE2ETestHook(compiler);
130
129
  const defaultDevServerConfig = await createDevServerConfig({
131
130
  cliOptions,
@@ -54,10 +54,14 @@ async function createBaseConfig({ props, isServer, minify, faster, configureWebp
54
54
  const CSSExtractPlugin = await (0, bundler_1.getCSSExtractPlugin)({
55
55
  currentBundler: props.currentBundler,
56
56
  });
57
- return {
58
- mode,
59
- name,
60
- cache: {
57
+ function getCache() {
58
+ if (props.currentBundler.name === 'rspack') {
59
+ // TODO Rspack only supports memory cache (as of Sept 2024)
60
+ // TODO re-enable file persistent cache one Rspack supports it
61
+ // See also https://rspack.dev/config/cache#cache
62
+ return undefined;
63
+ }
64
+ return {
61
65
  type: 'filesystem',
62
66
  // Can we share the same cache across locales?
63
67
  // Exploring that question at https://github.com/webpack/webpack/issues/13034
@@ -83,7 +87,12 @@ async function createBaseConfig({ props, isServer, minify, faster, configureWebp
83
87
  siteConfigPath,
84
88
  ],
85
89
  },
86
- },
90
+ };
91
+ }
92
+ return {
93
+ mode,
94
+ name,
95
+ cache: getCache(),
87
96
  output: {
88
97
  pathinfo: false,
89
98
  path: outDir,
@@ -100,7 +109,6 @@ async function createBaseConfig({ props, isServer, minify, faster, configureWebp
100
109
  },
101
110
  devtool: isProd ? undefined : 'eval-cheap-module-source-map',
102
111
  resolve: {
103
- unsafeCache: false, // Not enabled, does not seem to improve perf much
104
112
  extensions: ['.wasm', '.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
105
113
  symlinks: true, // See https://github.com/facebook/docusaurus/issues/3272
106
114
  roots: [
@@ -29,7 +29,7 @@ async function createBaseClientConfig({ props, hydrate, minify, faster, configur
29
29
  configureWebpackUtils,
30
30
  });
31
31
  const ProgressBarPlugin = await (0, bundler_1.getProgressBarPlugin)({
32
- currentBundler: configureWebpackUtils.currentBundler,
32
+ currentBundler: props.currentBundler,
33
33
  });
34
34
  return (0, webpack_merge_1.default)(baseConfig, {
35
35
  // Useless, disabled on purpose (errors on existing sites with no
@@ -53,6 +53,8 @@ class ChunkAssetPlugin {
53
53
  }
54
54
  exports.default = ChunkAssetPlugin;
55
55
  // Inspired by https://github.com/webpack/webpack/blob/v5.94.0/lib/runtime/CompatRuntimeModule.js
56
+ // See also https://rspack.dev/api/javascript-api/compilation#addruntimemodule
57
+ // See also https://rspack.dev/api/plugin-api/compilation-hooks#additionaltreeruntimerequirements
56
58
  class ChunkAssetRuntimeModule extends webpack_1.default.RuntimeModule {
57
59
  constructor() {
58
60
  super('ChunkAssetRuntimeModule', webpack_1.default.RuntimeModule.STAGE_ATTACH);
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-6100",
4
+ "version": "0.0.0-6101",
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": "0.0.0-6100",
37
- "@docusaurus/bundler": "0.0.0-6100",
38
- "@docusaurus/logger": "0.0.0-6100",
39
- "@docusaurus/mdx-loader": "0.0.0-6100",
40
- "@docusaurus/utils": "0.0.0-6100",
41
- "@docusaurus/utils-common": "0.0.0-6100",
42
- "@docusaurus/utils-validation": "0.0.0-6100",
36
+ "@docusaurus/babel": "0.0.0-6101",
37
+ "@docusaurus/bundler": "0.0.0-6101",
38
+ "@docusaurus/logger": "0.0.0-6101",
39
+ "@docusaurus/mdx-loader": "0.0.0-6101",
40
+ "@docusaurus/utils": "0.0.0-6101",
41
+ "@docusaurus/utils-common": "0.0.0-6101",
42
+ "@docusaurus/utils-validation": "0.0.0-6101",
43
43
  "boxen": "^6.2.1",
44
44
  "chalk": "^4.1.2",
45
45
  "chokidar": "^3.5.3",
@@ -78,8 +78,8 @@
78
78
  "webpack-merge": "^6.0.1"
79
79
  },
80
80
  "devDependencies": {
81
- "@docusaurus/module-type-aliases": "0.0.0-6100",
82
- "@docusaurus/types": "0.0.0-6100",
81
+ "@docusaurus/module-type-aliases": "0.0.0-6101",
82
+ "@docusaurus/types": "0.0.0-6101",
83
83
  "@total-typescript/shoehorn": "^0.1.2",
84
84
  "@types/detect-port": "^1.3.3",
85
85
  "@types/react-dom": "^18.2.7",
@@ -100,5 +100,5 @@
100
100
  "engines": {
101
101
  "node": ">=18.0"
102
102
  },
103
- "gitHead": "46fbfd180de4cef70d17a2ef4db047810a2f0381"
103
+ "gitHead": "16bade8e806ebfd77603c2e52d06a0208843122e"
104
104
  }