Skip to content

Commit 0fb2340

Browse files
authoredJul 21, 2023
fix: do not append browserHash on optimized deps during build (#13906)
1 parent c89f677 commit 0fb2340

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎packages/vite/src/node/plugins/resolve.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
250250
if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) {
251251
// Optimized files could not yet exist in disk, resolve to the full path
252252
// Inject the current browserHash version if the path doesn't have one
253-
if (!normalizedFsPath.match(DEP_VERSION_RE)) {
253+
if (
254+
!resolveOptions.isBuild &&
255+
!normalizedFsPath.match(DEP_VERSION_RE)
256+
) {
254257
const browserHash = optimizedDepInfoFromFile(
255258
depsOptimizer.metadata,
256259
normalizedFsPath,

0 commit comments

Comments
 (0)
Please sign in to comment.