Skip to content

Commit ffa7525

Browse files
authored
fix(bundler): fix docusaurus start using concatenateModules: true (#11222)
1 parent 1c454a9 commit ffa7525

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/docusaurus/src/webpack/base.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,6 @@ export async function createBaseConfig({
253253
modules: ['node_modules', path.join(siteDir, 'node_modules')],
254254
},
255255
optimization: {
256-
// The optimization.concatenateModules is expensive
257-
// - On the server, it's not useful to run it at all
258-
// - On the client, it leads to a ~3% JS assets total size decrease
259-
// Let's keep it by default, but large sites may prefer faster builds
260-
// See also https://github.com/facebook/docusaurus/pull/11176
261-
concatenateModules: !isServer,
262-
263256
// The optimization.mergeDuplicateChunks is expensive
264257
// - On the server, it's not useful to run it at all
265258
// - On the client, we compared assets/js before/after and see 0 change

packages/docusaurus/src/webpack/server.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ export default async function createServerConfig({
5252
color: 'yellow',
5353
}),
5454
],
55+
optimization: {
56+
// The optimization.concatenateModules is expensive
57+
// - On the server, it's not useful to run it at all
58+
// - On the client, it leads to a ~3% JS assets total size decrease
59+
// Let's keep it by default, but large sites may prefer faster builds
60+
// See also https://github.com/facebook/docusaurus/pull/11176
61+
// Note: we don't want to enable it on the client for "docusaurus start"
62+
// See also https://github.com/facebook/docusaurus/pull/11222
63+
concatenateModules: false,
64+
},
5565
});
5666

5767
return {config, serverBundlePath};

0 commit comments

Comments
 (0)