Skip to content

Commit b3bc40f

Browse files
committed
chore: fix vite changes
1 parent e503ec3 commit b3bc40f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path'
22
import minimatch from 'minimatch'
3-
import { Alias, ResolvedConfig } from 'vite'
3+
import { ResolvedConfig } from 'vite'
44
import { ComponentInfo, ResolvedOptions, Options } from './types'
55
import { LibraryResolver } from './helpers/libraryResolver'
66

@@ -123,17 +123,11 @@ export function getNameFromFilePath(filePath: string, options: ResolvedOptions):
123123
return filename
124124
}
125125

126-
export function resolveAlias(filepath: string, alias: ResolvedConfig['alias'] = {}) {
126+
export function resolveAlias(filepath: string, alias: ResolvedConfig['alias'] = []) {
127127
let result = filepath
128128
if (Array.isArray(alias)) {
129129
for (const { find, replacement } of alias)
130130
result.replace(find, replacement)
131131
}
132-
else {
133-
Object.entries(alias).forEach(([k, p]) => {
134-
if (k.startsWith('/') && k.endsWith('/') && result.startsWith(k))
135-
result = path.join(p, result.replace(k, ''))
136-
})
137-
}
138132
return result
139133
}

0 commit comments

Comments
 (0)