You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We don't have a server start hook in Next.js, and probably will never have one, because the serverless logic doesn't have a single "start" event.
Instead we should run a script once on "postbuild" or "predev", for instance to seed the db.
Our current workflow with "ncc"' from Vercel is slow and complex
Alternatives
NCC from Vercel is currently used to build scripts as TypeScript.
However, it makes the script totally standalone: that means importing a lot of code.
Esbuild-runner is probably more suited to our use case, where we only create scripts that are local to our Next.js application, for instance seeding the db from the app, or creating indexes.
Is your feature request related to a problem? Please describe.
We don't have a server start hook in Next.js, and probably will never have one, because the serverless logic doesn't have a single "start" event.
Instead we should run a script once on "postbuild" or "predev", for instance to seed the db.
Our current workflow with "ncc"' from Vercel is slow and complex
Alternatives
NCC from Vercel is currently used to build scripts as TypeScript.
However, it makes the script totally standalone: that means importing a lot of code.
Esbuild-runner is probably more suited to our use case, where we only create scripts that are local to our Next.js application, for instance seeding the db from the app, or creating indexes.
https://github.com/folke/esbuild-runner
However it faces some issues when we build non trivial libs: evanw/esbuild#2067
We have a demo in State of JS Next app that we may open source soon
The text was updated successfully, but these errors were encountered: