Skip to content

Commit 3661aa7

Browse files
authored
fix(gatsby): Regression in shared chunks (#36664)
1 parent 0f5ad0e commit 3661aa7

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

packages/gatsby/src/utils/webpack.config.js

+1-16
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ module.exports = async (
643643
},
644644
// if a module is bigger than 160kb from node_modules we make a separate chunk for it
645645
lib: {
646-
// Don't split up the page chunks as they won't be loaded by gatsby anyways
647646
test(module) {
648647
return (
649648
!isCssModule(module) &&
@@ -672,24 +671,10 @@ module.exports = async (
672671
// if a chunk is used on all components we put it in commons (we need at least 2 components)
673672
minChunks: Math.max(componentsCount, 2),
674673
priority: 20,
675-
// Don't split up the page chunks as they won't be loaded by gatsby anyways
676-
// test: isPartialHydrationEnabled
677-
// ? function (module, { chunkGraph }) {
678-
// for (const chunk of chunkGraph.getModuleChunksIterable(
679-
// module
680-
// )) {
681-
// if (chunk.name?.startsWith(`component---`)) {
682-
// return false
683-
// }
684-
// }
685-
686-
// return true
687-
// }
688-
// : undefined,
689674
},
690675
// If a chunk is used in at least 2 components we create a separate chunk
691676
shared: {
692-
test: module => isCssModule(module),
677+
test: module => !isCssModule(module),
693678
name(module, chunks) {
694679
const hash = crypto
695680
.createHash(`sha1`)

0 commit comments

Comments
 (0)