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 11import path from 'path'
22import minimatch from 'minimatch'
3- import { Alias , ResolvedConfig } from 'vite'
3+ import { ResolvedConfig } from 'vite'
44import { ComponentInfo , ResolvedOptions , Options } from './types'
55import { 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}
You can’t perform that action at this time.
0 commit comments