News for hackers. Stuff that matters.
Re:Migrating from Create React App to Vite by arbol on Thursday October 17, 2024 @04:31AM (#41867557)
Vite uses esbuild under the hood. It can also create bundles with all your deps, which is essential when you don't want an npm i step involved during deployment (lambdas/containers).
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
Re:Migrating from Create React App to Vite by silverwind on Thursday October 17, 2024 @05:30AM (#41867869)
Vite uses esbuild only during development, in the build it uses rollup.
Re:Migrating from Create React App to Vite by auggierose on Thursday October 17, 2024 @05:44AM (#41867950)
Yes, I've noticed that. So to debug problems I need to know both rollup and esbuild, and how exactly Vite configs boil down to configs for these two.
Re:Migrating from Create React App to Vite by solarkraft on Thursday October 17, 2024 @12:06PM (#41870934)
Has this happened to you? I expected this to happen to me, but I’ve never noticed a disparity.
Re:Migrating from Create React App to Vite by auggierose on Saturday October 19, 2024 @04:29AM (#41886494)
I've run into problems with Vite when I was using it for electron, and I could not figure out how to fix it. I needed to create a new project from scratch. Vite seems in general to be fast moving, and software depending on it breaks easily.