Skip to content

Commit

Permalink
perf: reduce vite client path checks
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Mar 17, 2023
1 parent 1a8af8d commit ad37bed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
DEFAULT_EXTENSIONS,
DEFAULT_MAIN_FIELDS,
ENV_ENTRY,
FS_PREFIX,
} from './constants'
import type {
InternalResolveOptions,
Expand Down Expand Up @@ -472,8 +473,8 @@ export async function resolveConfig(
)

const clientAlias = [
{ find: /^\/?@vite\/env/, replacement: ENV_ENTRY },
{ find: /^\/?@vite\/client/, replacement: CLIENT_ENTRY },
{ find: /^\/?@vite\/env/, replacement: FS_PREFIX + ENV_ENTRY },
{ find: /^\/?@vite\/client/, replacement: FS_PREFIX + CLIENT_ENTRY },
]

// resolve alias with internal client alias
Expand Down

0 comments on commit ad37bed

Please sign in to comment.