News for hackers. Stuff that matters.
Re:Migrating from Create React App to Vite by Aldipower on Thursday October 17, 2024 @04:46AM (#41867632)
To be clear, it is esbuild that bundles not vite.

esbuild index.js --bundle --outfile=build.cjs --format=cjs --platform=node

You can use pkg then to make this bundle executable.

pkg build.cjs

This is not vite. :-)

Re:Migrating from Create React App to Vite by arbol on Thursday October 17, 2024 @05:04AM (#41867723)
Fair point. But vite makes this easier than esbuild. I get a bundle that's immediately executable with node