Skip to content

Commit

Permalink
add no-deps flag on vsce package cmd
Browse files Browse the repository at this point in the history
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
  • Loading branch information
zFernand0 committed Oct 13, 2023
1 parent f385bd5 commit d37f22f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/vsce.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion packages/vsce/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,25 @@ export async function vsceInfo(extensionName: string): Promise<Record<string, an

export async function vscePackage(context: IContext): Promise<string> {
const cmdArgs = ["vsce", "package"];
const npx_cmd = await npxCmd();
if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) {
cmdArgs.push("--yarn");
}
if (context.version.prerelease != null) {
cmdArgs.push("--pre-release");
}
const cmdOutput = await exec.getExecOutput(await npxCmd(), cmdArgs);
if (usePnpm) {
// Skip dependency analysis since we webpack as part of our build process
// Source: https://github.com/microsoft/vscode-vsce/issues/758#issuecomment-1282081038
// This prevents the common **/json5 issue when the vsce process runs an `npm list` command
/**
* ERROR Command failed: npm list --production --parseable --depth=99999 --loglevel=error
* npm ERR! Override without name: **\/json5
* npm ERR! A complete log of this run can be found in: /path/to/npm/log
*/
cmdArgs.push("--no-dependencies");
}
const cmdOutput = await exec.getExecOutput(npx_cmd, cmdArgs);
return cmdOutput.stdout.trim().match(/Packaged: (.*\.vsix)/)?.[1] as string;
}

Expand Down

0 comments on commit d37f22f

Please sign in to comment.