Description
Hi!
Right now, if I want to run a plain Node.js file with Vite+, I still have to use node directly or use vp env exec node test.js, which feels a bit outside the vp world. I think it would be really nice if Vite+ could run .js and .ts files natively, so we can stay in the vp ecosystem the whole time.
Suggested solution
Add a vp node command that runs a JavaScript or TypeScript file directly using Vite+'s managed runtime:
vp node index.js
vp node scripts/seed.ts
It would be great if this also:
- Supports TypeScript out of the box
- Respects path aliases from
vite.config.ts
- Uses Vite+'s managed Node.js version
Alternative
If a new vp node command is too much, maybe vp run could also accept a file path directly:
Or, the current vp env exec node test.js workaround could be shortened to something simpler.
Additional context
Vite+ already does a great job combining Vite, Vitest, Oxlint, Oxfmt, and more into one tool. Being able to run Node.js files directly would make it a complete toolchain for any JavaScript project, not just frontend. This would be a great DX improvement!
This is my first issue on this project — sorry if this has already been discussed before!
If you have any feedback or comments, do not hesitate to let me know.
Validations
Description
Hi!
Right now, if I want to run a plain Node.js file with Vite+, I still have to use
nodedirectly or usevp env exec node test.js, which feels a bit outside thevpworld. I think it would be really nice if Vite+ could run.jsand.tsfiles natively, so we can stay in thevpecosystem the whole time.Suggested solution
Add a
vp nodecommand that runs a JavaScript or TypeScript file directly using Vite+'s managed runtime:It would be great if this also:
vite.config.tsAlternative
If a new
vp nodecommand is too much, maybevp runcould also accept a file path directly:Or, the current
vp env exec node test.jsworkaround could be shortened to something simpler.Additional context
Vite+ already does a great job combining Vite, Vitest, Oxlint, Oxfmt, and more into one tool. Being able to run Node.js files directly would make it a complete toolchain for any JavaScript project, not just frontend. This would be a great DX improvement!
This is my first issue on this project — sorry if this has already been discussed before!
If you have any feedback or comments, do not hesitate to let me know.
Validations