Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer tsup to ncc #156

Closed
eric-burel opened this issue Mar 24, 2022 · 2 comments
Closed

Prefer tsup to ncc #156

eric-burel opened this issue Mar 24, 2022 · 2 comments

Comments

@eric-burel
Copy link
Collaborator

eric-burel commented Mar 24, 2022

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

  • As usual, Tsup is killing it and works perfect
    We have a demo in State of JS Next app that we may open source soon
@eric-burel eric-burel changed the title Prefer esbuild-runner to ncc Prefer tsup to ncc Jul 21, 2022
@SachaG
Copy link

SachaG commented Dec 29, 2022

Lol I ended up here after running into esbuild issues with tsup…

@janjakubnanista
Copy link

@SachaG the same here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants