turbopack: Rewrite ESM modules to CJS during client transition (#55693)
### What? I'm not sure if this is necessary, but while investigating #55689 I found that the RSC code that we send to the client continues to use the ESM outputs during resolution. The problem is that the RSC server code uses ESM, then tries to send that down to the client. We have a `NextSharedRuntimeResolvePlugin` which handles rewriting _some_ modules (the shared runtimes) to CJS, but that doesn't apply to the main entry points that are RSC rendered, like `app-router`. ### Why? Webpack seems to only resolve to CJS routes. ### How? We manually rewrite "transition" entry points to the CJS output, just like the resolve plugin. Closes WEB-1618
Showing
Please
register
or
sign in
to comment