rsnext/packages/next/lib/chalk.ts
Shu Ding 99d4d6c5a4
Implement web server as the request handler for edge SSR (#33635)
(#31506 for context)

This PR implements the minimum viable web server on top of the Next.js base server, and integrates it into our middleware (edge) SSR runtime to handle all the requests.

This also addresses problems like missing dynamic routes support in our current handler.

Note that this is the initial implementation with the assumption that the web server is running under minimal mode. Also later we can refactor the `__server_context` environment to properly passing the context via the constructor or methods.
2022-01-26 06:22:11 +00:00

9 lines
198 B
TypeScript

let chalk: typeof import('next/dist/compiled/chalk')
if (!process.browser) {
chalk = require('next/dist/compiled/chalk')
} else {
chalk = require('./web/chalk').default
}
export default chalk