Skip to content

Commit ecb849a

Browse files
committed
test: restore chunk splitting in middleware for Edge Runtime case
1 parent e55448f commit ecb849a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/fixtures/middleware/next.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ const nextConfig = {
1111
webpack: (config) => {
1212
// this is a trigger to generate multiple `.next/server/middleware-[hash].js` files instead of
1313
// single `.next/server/middleware.js` file
14-
// this doesn't seem to actually work with Node Middleware - it result in next build failures
15-
// config.optimization.splitChunks.maxSize = 100_000
14+
if (process.env.SPLIT_CHUNKS) {
15+
// this doesn't seem to actually work with Node Middleware - it result in next build failures
16+
// so we only do this for default/Edge Runtime
17+
config.optimization.splitChunks.maxSize = 100_000
18+
}
1619

1720
return config
1821
},

tests/fixtures/middleware/test-variants.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
"default": {
3+
"env": {
4+
"SPLIT_CHUNKS": "true"
5+
}
6+
},
27
"node-middleware": {
38
"distDir": ".next-node-middleware",
49
"files": {

0 commit comments

Comments
 (0)