Skip to content

Commit

Permalink
chore: try fix resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 26, 2021
1 parent a25e4af commit 4977cab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/slidev/node/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ensurePrefix, slash } from '@antfu/utils'
import { sync as resolve } from 'resolve'
import resolveFrom from 'resolve-from'
import resolveGlobal from 'resolve-global'

export function toAtFS(path: string) {
Expand All @@ -16,6 +17,11 @@ export function resolveImportPath(importName: string, ensure = false) {
}
catch {}

try {
return resolveFrom(importName, __dirname)
}
catch {}

try {
return resolveGlobal(importName)
}
Expand Down
1 change: 1 addition & 0 deletions packages/slidev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"prismjs": "^1.23.0",
"prompts": "^2.4.1",
"resolve": "^1.20.0",
"resolve-from": "^5.0.0",
"resolve-global": "^1.0.0",
"shiki": "^0.9.4",
"sirv": "^1.0.12",
Expand Down
3 changes: 2 additions & 1 deletion pnpm-lock.yaml

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

0 comments on commit 4977cab

Please sign in to comment.