mirror of
https://github.com/alex8088/electron-vite.git
synced 2025-10-13 02:12:13 +08:00
Add negative lookbehind for comment in static import regex
This commit is contained in:
parent
1eeb15ea77
commit
d5a103f980
@ -31,7 +31,7 @@ const require = __cjs_mod__.createRequire(import.meta.url);
|
|||||||
`
|
`
|
||||||
|
|
||||||
const ESMStaticImportRe =
|
const ESMStaticImportRe =
|
||||||
/(?<=\s|^|;)import\s*([\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu
|
/(?<!\/\/.*?)(?<=\s|^|;)import\s*([\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu
|
||||||
|
|
||||||
interface StaticImport {
|
interface StaticImport {
|
||||||
end: number
|
end: number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user