File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,10 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
175175 // as if they would have been imported through a bare import
176176 // Use the original id to do the check as the resolved id may be the real
177177 // file path after symlinks resolution
178- const isNodeModule = ! ! normalizePath ( id ) . match ( nodeModulesInPathRE )
178+ const isNodeModule =
179+ nodeModulesInPathRE . test ( normalizePath ( id ) ) ||
180+ nodeModulesInPathRE . test ( normalizePath ( resolved ) )
181+
179182 if ( isNodeModule && ! resolved . match ( DEP_VERSION_RE ) ) {
180183 const versionHash = depsOptimizer . metadata . browserHash
181184 if ( versionHash && OPTIMIZABLE_ENTRY_RE . test ( resolved ) ) {
You can’t perform that action at this time.
0 commit comments