From 79390025fc3bb6b23dcdacdbb1e52c96bc08d08a Mon Sep 17 00:00:00 2001 From: Kangrui Ye Date: Wed, 13 Dec 2023 14:15:01 +0100 Subject: [PATCH] fix publish for real Signed-off-by: Kangrui Ye --- tools/scripts/publish.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/scripts/publish.mjs b/tools/scripts/publish.mjs index f880e4d..d1238b6 100644 --- a/tools/scripts/publish.mjs +++ b/tools/scripts/publish.mjs @@ -33,11 +33,13 @@ if (outputPath == null) { throw new Error('there is no output path for the project'); } +const packageJson = devkit.readJsonFile(`${devkit.workspaceRoot}/package.json`); + const actualOutputPath = outputPath.startsWith('{workspaceRoot}/') ? outputPath.slice('{workspaceRoot}/'.length) : outputPath; invariant(actualOutputPath, `Could not find "build.options.outputPath" of project "${name}". Is project.json configured correctly?`); process.chdir(actualOutputPath); -// Execute "yarn publish" to publish -execSync(`yarn npm publish`); +// Execute "yarn npm publish" to publish +execSync(`volta run --yarn ${packageJson.volta.yarn} yarn npm publish`);