-
Notifications
You must be signed in to change notification settings - Fork 157
Feature Request: Native Node.js Script Execution via vp node or vp run #1325
Description
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.tsIt 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:
vp run index.jsOr, 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
- Read the Contributing Guidelines.
- Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- Check that there isn't already an issue requesting the same feature.
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackPriority
Start date
Target date
Effort