File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'path'
2
2
import minimatch from 'minimatch'
3
- import { Alias , ResolvedConfig } from 'vite'
3
+ import { ResolvedConfig } from 'vite'
4
4
import { ComponentInfo , ResolvedOptions , Options } from './types'
5
5
import { LibraryResolver } from './helpers/libraryResolver'
6
6
@@ -123,17 +123,11 @@ export function getNameFromFilePath(filePath: string, options: ResolvedOptions):
123
123
return filename
124
124
}
125
125
126
- export function resolveAlias ( filepath : string , alias : ResolvedConfig [ 'alias' ] = { } ) {
126
+ export function resolveAlias ( filepath : string , alias : ResolvedConfig [ 'alias' ] = [ ] ) {
127
127
let result = filepath
128
128
if ( Array . isArray ( alias ) ) {
129
129
for ( const { find, replacement } of alias )
130
130
result . replace ( find , replacement )
131
131
}
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
- }
138
132
return result
139
133
}
You can’t perform that action at this time.
0 commit comments