Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tests-canary-update
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Aug 27, 2024
2 parents 7da023f + 733a021 commit 885be4d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.6.0"
".": "5.7.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [5.7.0](https://github.com/netlify/next-runtime/compare/v5.6.0...v5.7.0) (2024-08-26)


### Features

* support next/image with static exports ([#2563](https://github.com/netlify/next-runtime/issues/2563)) ([b000c43](https://github.com/netlify/next-runtime/commit/b000c430ce486279178f3aa5f275c66a508fb1c8))


### Bug Fixes

* handle cases of chunked middleware ([#2574](https://github.com/netlify/next-runtime/issues/2574)) ([666fe5a](https://github.com/netlify/next-runtime/commit/666fe5a6f54c1134fe80054adcf6aac4aec1ec58))

## [5.6.0](https://github.com/netlify/next-runtime/compare/v5.5.1...v5.6.0) (2024-07-29)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/plugin-nextjs",
"version": "5.6.0",
"version": "5.7.0",
"description": "Run Next.js seamlessly on Netlify",
"main": "./dist/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/build/functions/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const copyHandlerDependencies = async (
const entrypoint = await readFile(join(srcDir, file), 'utf8')
parts.push(`;// Concatenated file: ${file} \n`, entrypoint)
}
const exports = `export default _ENTRIES["middleware_${name}"].default;`
const exports = `const middlewareEntryKey = Object.keys(_ENTRIES).find(entryKey => entryKey.startsWith("middleware_${name}")); export default _ENTRIES[middlewareEntryKey].default;`
await mkdir(dirname(join(destDir, `server/${name}.js`)), { recursive: true })

await writeFile(join(destDir, `server/${name}.js`), [...parts, exports].join('\n'))
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/middleware/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
webpack: (config) => {
// this is a trigger to generate multiple `.next/server/middleware-[hash].js` files instead of
// single `.next/server/middleware.js` file
config.optimization.splitChunks.maxSize = 100_000

return config
},
}

module.exports = nextConfig

0 comments on commit 885be4d

Please sign in to comment.