diff --git a/src/analyze.ts b/src/analyze.ts index 0b66ba0..f499f84 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -62,7 +62,7 @@ export interface DefaultExport extends ESMExport { } export const ESM_STATIC_IMPORT_RE = - /(?<=\s|^|;)import\s*([\s"']*(?[\p{L}\p{M}\w\t\n\r $*,/{}]+)from\s*)?["']\s*(?(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu; + /(?<=\s|^|;)import\s*([\s"']*(?[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu; export const DYNAMIC_IMPORT_RE = /import\s*\((?(?:[^()]+|\((?:[^()]+|\([^()]*\))*\))*)\)/gm; const IMPORT_NAMED_TYPE_RE = diff --git a/test/imports.test.ts b/test/imports.test.ts index 7269736..d17ede4 100644 --- a/test/imports.test.ts +++ b/test/imports.test.ts @@ -102,7 +102,7 @@ const c = ['.mjs', '.cjs', '.js', '.json'] staticTests[ `import { member1, - // test + // @hello.123 member2 } from "module-name";` ] = {