Skip to content

Commit 3376754

Browse files
committed
feat: allow explicitly disabling Vite+'s Node.js version management with node-version: off
1 parent 591ba1c commit 3376754

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ inputs:
2222
required: false
2323
default: "false"
2424
node-version:
25-
description: "Node.js version to install via `vp env use`. Defaults to Node.js latest LTS version."
25+
description: "Node.js version to install via `vp env use`. Defaults to Node.js latest LTS version. Pass `off` to disable."
2626
required: false
2727
node-version-file:
2828
description: "Path to file containing the Node.js version spec (.nvmrc, .node-version, .tool-versions, package.json). Ignored when node-version is specified."

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ async function runMain(inputs: Inputs): Promise<void> {
3030
await installVitePlus({ ...inputs, version });
3131

3232
// Step 3: Set up Node.js version if specified
33-
if (nodeVersion) {
33+
if (nodeVersion && nodeVersion !== "off") {
3434
info(`Setting up Node.js ${nodeVersion} via vp env use...`);
3535
await exec("vp", ["env", "use", nodeVersion]);
36+
} else if (nodeVersion === "off") {
37+
info("Disabling Node.js version management with vp env off...");
38+
await exec("vp", ["env", "off"]);
3639
}
3740

3841
// Step 4: Configure registry authentication

0 commit comments

Comments
 (0)