fix(js): allow inlineable dependency to be added to externals (#21051)

This commit is contained in:
Jack Hsu 2024-01-09 13:32:46 -05:00 committed by GitHub
parent 40cbae2fae
commit 6307a831d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,7 +309,8 @@ function recursiveUpdateImport(
const updatedContent = fileContent.replace(importRegex, (matched) => {
const result = matched.replace(/['"]/g, '');
// If a match is the same as the rootParentDir, we're checking its own files so we return the matched as in no changes.
if (result === rootParentDir) return matched;
if (result === rootParentDir || !inlinedDepsDestOutputRecord[result])
return matched;
const importPath = `"${relative(
dirPath,
inlinedDepsDestOutputRecord[result]