We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7706d0 commit 1b822d0Copy full SHA for 1b822d0
packages/vite/src/node/plugins/resolve.ts
@@ -175,7 +175,10 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
175
// as if they would have been imported through a bare import
176
// Use the original id to do the check as the resolved id may be the real
177
// file path after symlinks resolution
178
- const isNodeModule = !!normalizePath(id).match(nodeModulesInPathRE)
+ const isNodeModule =
179
+ nodeModulesInPathRE.test(normalizePath(id)) ||
180
+ nodeModulesInPathRE.test(normalizePath(resolved))
181
+
182
if (isNodeModule && !resolved.match(DEP_VERSION_RE)) {
183
const versionHash = depsOptimizer.metadata.browserHash
184
if (versionHash && OPTIMIZABLE_ENTRY_RE.test(resolved)) {
0 commit comments