Skip to content

Feature Request: Native Node.js Script Execution via vp node or vp run #1325

@runyasak

Description

@runyasak

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:

vp run index.js

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

  • 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

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions