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
I would like to add a new template to this repository or update existing projects with an Express server written in TypeScript and production-ready build setup. What do you think? What would be the best approach?
Hi! Thanks for sharing your templates, and great setup with tsup + nodemon.
I'm open to having the server script be in TS. Since the templates here are often used as a learning resource and reproductions, I'd like to keep it a single file still so it's easier to digest, but I'm sure it shouldn't be too hard to refactor as a directory like yours later.
Instead of a build step, I've been thinking that we could use tsx to execute the server.ts file directly in both dev and prod 🤔 It might take slightly more time to startup but I think it makes configuring easier, plus matches nicely with node --experimental-strip-types once it stabilizes. There's also builtin tsx watch mode for dev. The only downside is that it relies on esbuild v0.23, while vite uses v0.24, but it's probably not the end of the world.
Curious what do you think and if you've tried this setup before?
I like the "keep it simple" approach, but I'm more interested in creating a production-ready template for custom SSR. Something that allows you to build a project, delete node_modules, and still run it. Do you think this repository is the right place for that?
Server-side code doesn't necessarily need to be bundled to work, so I'd prefer to avoid another build tooling there. Even with Vite's SSR output it also defaults to externalising all dependencies, and expect deployments to run npm install --prod, so I'd like to stick with that convention.
If you prefer to keep the build step, then I think having it in a separate template repo is good for now.
I would like to add a new template to this repository or update existing projects with an Express server written in TypeScript and production-ready build setup. What do you think? What would be the best approach?
Here are examples from my repositories:
The server could be updated in these templates:
I chose to build the TypeScript server using
tsup
. Any thoughts?The text was updated successfully, but these errors were encountered: