Skip to content

Commit c010393

Browse files
committed
fix: use default import for resolve, close #131
1 parent 743630b commit c010393

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { parse } from 'path'
22
import minimatch from 'minimatch'
3+
import resolve from 'resolve'
34
import { ResolvedConfig } from 'vite'
45
import { slash, toArray } from '@antfu/utils'
5-
import { sync as resolve } from 'resolve'
66
import { ComponentInfo, ResolvedOptions, ImportInfo } from '../types'
77
import { Context } from './context'
88
import { DISABLE_COMMENT } from './constants'
@@ -158,7 +158,7 @@ export function shouldTransform(code: string) {
158158
}
159159

160160
export function resolveImportPath(importName: string): string | undefined {
161-
return resolve(importName, {
161+
return resolve.sync(importName, {
162162
preserveSymlinks: false,
163163
})
164164
}

0 commit comments

Comments
 (0)