Skip to content

Commit

Permalink
feat: prefer offline install for speed when doing auto import
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 2, 2021
1 parent a02085f commit 0d607d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
"release": "npx bumpp --commit --tag --push && npm publish"
},
"dependencies": {
"@antfu/install-pkg": "^0.0.0",
"@antfu/install-pkg": "^0.1.0",
"@antfu/utils": "^0.3.0",
"@iconify/json-tools": "^1.0.10",
"@iconify/utils": "^1.0.10",
"chalk": "^4.1.2",
"debug": "^4.3.2",
"local-pkg": "^0.2.0",
"local-pkg": "^0.3.0",
"unplugin": "^0.2.16"
},
"devDependencies": {
Expand Down
17 changes: 9 additions & 8 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function tryInstallPkg(name: string) {
if (!tasks[name]) {
// eslint-disable-next-line no-console
console.log(cyan(`Installing ${name}...`))
tasks[name] = pending = installPackage(name, { dev: true })
tasks[name] = pending = installPackage(name, { dev: true, preferOffline: true })
.then(() => sleep(300))
.catch((e) => {
warnOnce(`Failed to install ${name}`)
Expand Down

0 comments on commit 0d607d6

Please sign in to comment.