Skip to content

Commit

Permalink
perf(resolve): reduce vite client path checks (#12471)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Apr 6, 2023
1 parent 80c526e commit c49af23
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/vite/src/node/config.ts
Expand Up @@ -48,6 +48,7 @@ import {
DEFAULT_EXTENSIONS,
DEFAULT_MAIN_FIELDS,
ENV_ENTRY,
FS_PREFIX,
} from './constants'
import type {
InternalResolveOptions,
Expand Down Expand Up @@ -475,8 +476,14 @@ export async function resolveConfig(
)

const clientAlias = [
{ find: /^\/?@vite\/env/, replacement: ENV_ENTRY },
{ find: /^\/?@vite\/client/, replacement: CLIENT_ENTRY },
{
find: /^\/?@vite\/env/,
replacement: path.posix.join(FS_PREFIX, normalizePath(ENV_ENTRY)),
},
{
find: /^\/?@vite\/client/,
replacement: path.posix.join(FS_PREFIX, normalizePath(CLIENT_ENTRY)),
},
]

// resolve alias with internal client alias
Expand Down

0 comments on commit c49af23

Please sign in to comment.