Skip to content

Commit

Permalink
fix(vscode): with lock version (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <github@antfu.me>
  • Loading branch information
Simon-He95 and antfu authored Aug 14, 2024
1 parent 73120e8 commit c94cb17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/addons/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const addonVSCode: Addon = {
if (version && pkg.raw.engines?.vscode !== version) {
// eslint-disable-next-line no-console
console.log(`[addon] Updated VS Code engine field to ${version}`)
pkg.raw.engines.vscode = version
// If the version is not a range (fixed version), we prepend it with a caret
pkg.raw.engines.vscode = /[>^<:~]/.test(version) ? version : `^${version}`
}
},
}

0 comments on commit c94cb17

Please sign in to comment.