Skip to content

Commit 3a2555d

Browse files
authored
deps: replace resolve with mlly (#775)
1 parent 3e2c889 commit 3a2555d

File tree

4 files changed

+31
-27
lines changed

4 files changed

+31
-27
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"local-pkg": "^0.5.0",
102102
"magic-string": "^0.30.10",
103103
"minimatch": "^9.0.4",
104-
"resolve": "^1.22.8",
104+
"mlly": "^1.7.1",
105105
"unplugin": "^1.10.1"
106106
},
107107
"devDependencies": {
@@ -112,7 +112,6 @@
112112
"@types/debug": "^4.1.12",
113113
"@types/minimatch": "^5.1.2",
114114
"@types/node": "^20.12.7",
115-
"@types/resolve": "^1.20.6",
116115
"bumpp": "^9.4.1",
117116
"compare-versions": "^6.1.0",
118117
"element-plus": "^2.7.2",

pnpm-lock.yaml

+27-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/resolvers/veui.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { join, normalize } from 'node:path'
2+
import { resolvePathSync } from 'mlly'
23
import type { ComponentResolver, SideEffectsInfo } from '../../types'
3-
import { camelCase, kebabCase, pascalCase, resolveImportPath } from '../utils'
4+
import { camelCase, kebabCase, pascalCase } from '../utils'
45

56
interface VeuiPeerConfig {
67
/**
@@ -109,7 +110,7 @@ const peerPaths = new Map<string, boolean>()
109110
function assertPeerPath(peerPath: string) {
110111
if (!peerPaths.has(peerPath)) {
111112
try {
112-
resolveImportPath(peerPath)
113+
resolvePathSync(peerPath)
113114
peerPaths.set(peerPath, true)
114115
}
115116
catch (e) {

src/core/utils.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { parse } from 'node:path'
22
import process from 'node:process'
33
import { minimatch } from 'minimatch'
4-
import resolve from 'resolve'
54
import { slash, toArray } from '@antfu/utils'
65
import {
76
getPackageInfo,
@@ -221,9 +220,3 @@ export function shouldTransform(code: string) {
221220
return false
222221
return true
223222
}
224-
225-
export function resolveImportPath(importName: string): string | undefined {
226-
return resolve.sync(importName, {
227-
preserveSymlinks: false,
228-
})
229-
}

0 commit comments

Comments
 (0)