Skip to content

Commit

Permalink
fix: do not append browserHash on optimized deps during build (#13906)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsdsjy authored Jul 21, 2023
1 parent c89f677 commit 0fb2340
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) {
// Optimized files could not yet exist in disk, resolve to the full path
// Inject the current browserHash version if the path doesn't have one
if (!normalizedFsPath.match(DEP_VERSION_RE)) {
if (
!resolveOptions.isBuild &&
!normalizedFsPath.match(DEP_VERSION_RE)
) {
const browserHash = optimizedDepInfoFromFile(
depsOptimizer.metadata,
normalizedFsPath,
Expand Down

0 comments on commit 0fb2340

Please sign in to comment.