Skip to content

Commit e4870d0

Browse files
committed
fix: ignore imports inside strings better
1 parent 9d2ec3e commit e4870d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const getOverrideConfig = (overrides, filepath, config) => {
5757
}
5858
const importPrefix = /^(?:(\.{1,2}\/)+)|^\/|^.+:\/\/\/?[.-\w]+\//
5959
const dynamicImportsWithoutComments =
60-
/(?<![\w.]|#!|\*[\s\w]*?|\/\/\s*|['"``]\s*)import\s*\((?!\s*\/\*)(?<path>\s*?['"`][^)]+['"`]\s*)\)(?!\s*?\*\/)/g
60+
/(?<![\w.]|#!|\*[\s\w]*?|\/\/\s*|['"`][^)$]*)import\s*\((?!\s*\/\*)(?<path>\s*?['"`][^)]+['"`]\s*)\)(?!\s*?\*\/)/g
6161

6262
export {
6363
getOverrideConfig,

0 commit comments

Comments
 (0)