File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import {
2929 isFileReadable ,
3030 isNonDriveRelativeAbsolutePath ,
3131 isObject ,
32+ isOptimizable ,
3233 isPossibleTsOutput ,
3334 isTsRequest ,
3435 isWindows ,
@@ -181,7 +182,7 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
181182
182183 if ( isNodeModule && ! resolved . match ( DEP_VERSION_RE ) ) {
183184 const versionHash = depsOptimizer . metadata . browserHash
184- if ( versionHash && OPTIMIZABLE_ENTRY_RE . test ( resolved ) ) {
185+ if ( versionHash && isOptimizable ( resolved , depsOptimizer . options ) ) {
185186 resolved = injectQuery ( resolved , `v=${ versionHash } ` )
186187 }
187188 }
@@ -750,7 +751,9 @@ export function tryNodeResolve(
750751 }
751752
752753 // if we reach here, it's a valid dep import that hasn't been optimized.
753- const isJsType = OPTIMIZABLE_ENTRY_RE . test ( resolved )
754+ const isJsType = depsOptimizer
755+ ? isOptimizable ( resolved , depsOptimizer . options )
756+ : OPTIMIZABLE_ENTRY_RE . test ( resolved )
754757
755758 let exclude = depsOptimizer ?. options . exclude
756759 let include = depsOptimizer ?. options . exclude
You can’t perform that action at this time.
0 commit comments