From d05dfccc0fb781c29a9841386cdd4c0dd95406b0 Mon Sep 17 00:00:00 2001 From: "MK (fengmk2)" Date: Tue, 24 Nov 2026 14:58:38 +0800 Subject: [PATCH 1/7] docs(rfc): design import.meta.glob support for vpx scripts Add a Glob Imports section to the vpx script RFC. The loader expands each import.meta.glob call before the oxc-node transform, keeps every original line and column, and reports matched files and patterns to the watcher so vpx --watch restarts when matches change. Refs #3525 Co-Authored-By: Claude Opus 5.5 --- rfcs/script-import-loader.md | 6 ++ rfcs/vpx-script-execution.md | 196 ++++++++++++++++++++++++++++++++++- 2 files changed, 200 insertions(+), 2 deletions(-) diff --git a/rfcs/script-import-loader.md b/rfcs/script-import-loader.md index eea1a599cb..497b656201 100644 --- a/rfcs/script-import-loader.md +++ b/rfcs/script-import-loader.md @@ -88,6 +88,12 @@ CommonJS resolution, JSX defaults, or supported decorator syntax. The acceptance claim is complete replacement of the **preload integration surface**, not identical output for every program accepted by tsx. +[Glob imports](./vpx-script-execution.md#glob-imports) are a proposal for the shared +loader. With them, the public entry expands `import.meta.glob` as `vpx` does. +Node.js' own watch mode restarts for the matched files that the loader reports. +It does not read the pattern reports, so a new matching file does not restart it. +`vpx --watch` does. + The first nonempty environment variable in this order selects one tsconfig for resolution and transforms: diff --git a/rfcs/vpx-script-execution.md b/rfcs/vpx-script-execution.md index 8744d14253..642832f810 100644 --- a/rfcs/vpx-script-execution.md +++ b/rfcs/vpx-script-execution.md @@ -1,6 +1,6 @@ # RFC: Run TypeScript Scripts with `vpx` -- Status: Implemented in [#2936](https://github.com/voidzero-dev/vite-plus/pull/2936); CI covers Linux, macOS, and Windows on Node.js 22, 24, and 26 +- Status: Implemented in [#2936](https://github.com/voidzero-dev/vite-plus/pull/2936); CI covers Linux, macOS, and Windows on Node.js 22, 24, and 26. [Glob Imports](#glob-imports) is a proposal for [#3525](https://github.com/voidzero-dev/vite-plus/issues/3525) and is not implemented yet - Related: [`vpx` command](./vpx-command.md), [JavaScript runtime management](./js-runtime.md), [CLI bundling](../packages/cli/BUNDLING.md), [Core binding resolution](./core-binding-resolution.md) - Upstream: [oxc-node](https://github.com/oxc-project/oxc-node) at the revision in [the upstream pins](../packages/tools/.upstream-versions.json), vendored and compiled into the Vite+ native binding, as Rolldown is - Prior art: [tsx](https://github.com/privatenumber/tsx) 4.23.15 @@ -36,6 +36,7 @@ Repositories use `tsx` to run `scripts/*.ts`. Vite+ manages the Node.js version 6. The loader ships inside `vite-plus`: no new npm package, no user dependency. 7. `vpx