Skip to content
Permalink
Browse files
fix: ensure version query for relative node_modules imports (#10016)
  • Loading branch information
ElMassimo committed Sep 6, 2022
1 parent a7706d0 commit 1b822d0598a6e13108da541e37d6e0ccb5c226f3
Showing 1 changed file with 4 additions and 1 deletion.
@@ -175,7 +175,10 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
// as if they would have been imported through a bare import
// Use the original id to do the check as the resolved id may be the real
// file path after symlinks resolution
const isNodeModule = !!normalizePath(id).match(nodeModulesInPathRE)
const isNodeModule =
nodeModulesInPathRE.test(normalizePath(id)) ||
nodeModulesInPathRE.test(normalizePath(resolved))

if (isNodeModule && !resolved.match(DEP_VERSION_RE)) {
const versionHash = depsOptimizer.metadata.browserHash
if (versionHash && OPTIMIZABLE_ENTRY_RE.test(resolved)) {

0 comments on commit 1b822d0

Please sign in to comment.