File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -122,9 +122,10 @@ export function assetImportMetaUrlPlugin(config: ResolvedConfig): Plugin {
122122 preferRelative : true ,
123123 } )
124124 file = await assetResolver ( url , id )
125- file ??= url . startsWith ( '/' )
126- ? slash ( path . join ( config . publicDir , url ) )
127- : slash ( path . resolve ( path . dirname ( id ) , url ) )
125+ file ??=
126+ url [ 0 ] === '/'
127+ ? slash ( path . join ( config . publicDir , url ) )
128+ : slash ( path . resolve ( path . dirname ( id ) , url ) )
128129 }
129130
130131 // Get final asset URL. If the file does not exist,
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ export async function toAbsoluteGlob(
619619 if ( glob . startsWith ( '../' ) ) return pre + posix . join ( dir , glob )
620620 if ( glob . startsWith ( '**' ) ) return pre + glob
621621
622- const isSubImportsPattern = glob . startsWith ( '#' ) && glob . includes ( '*' )
622+ const isSubImportsPattern = glob [ 0 ] === '#' && glob . includes ( '*' )
623623
624624 const resolved = normalizePath (
625625 ( await resolveId ( glob , importer , {
You can’t perform that action at this time.
0 commit comments