rsnext/packages/next-swc
OJ Kwon 1f3178e743
fix(next-core): allow runtime segment option in pages/api (#58409)
### What

This PR fixes turbopack to allow runtime segment option (https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-Option) in pages/api. 

Previously it only allows config object (https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher), so the single runtime export like `export const runtime = 'edge'` didn't work. PR updates logic to parse config in the module to allow single segment export as well.

It doesn't allow _both_, if config object is exported it'll short-curcuit to read values as config object should able to specify runtime without separate runtime segment.

Closes PACK-1961
2023-11-17 20:59:01 +00:00
..
crates fix(next-core): allow runtime segment option in pages/api (#58409) 2023-11-17 20:59:01 +00:00
native Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
package.json v14.0.4-canary.2 2023-11-17 15:05:24 +00:00
README.md docs: add readme with development instructions for next/swc (#43834) 2022-12-08 13:38:44 +01:00

@next/swc

This package is responsible for swc compilation customized for next.js

Development

Run tests

cargo test

# Update snapshots and fixtures for tests
UPDATE=1 cargo test

Format code before submitting code

cargo fmt

Build the binary to integrate with next.js

pnpm build-native