Replies: 3 comments 1 reply
-
Next.js doesn't handle this scenario, we provide the API for the server to start the Next.js app, but we don't have any control over what happens on your custom server. |
Beta Was this translation helpful? Give feedback.
-
You can use @babel/node or @babel/register to transpile/compile ES6 syntax, although it comes with its own caveats: Slower development boot up, it may require another babel configuration (one specifically for node), and will require that you manually compile ES6 code to its own build/dist folder (otherwise, you'll be transpiling/compiling code in production, which is not very optimal). If Vercel would like an example repo, I can provide one; although, I feel it won't be very beginning-junior developer-friendly. On that note, newer versions of Node (14.x) already natively (experimentally!) support ES6 modules, which includes |
Beta Was this translation helpful? Give feedback.
-
I've already used |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to optimally translate the code of a custom server through babel? I also need the server-side es6 syntax. I've seen all topics about this problem, but none of them satisfy me.
Beta Was this translation helpful? Give feedback.
All reactions