Skip to content

Commit fe26d4d

Browse files
VieZhongviezhong
and
viezhong
authored
fix: suport import function that with webpackChunkName comment (#164)
Co-authored-by: viezhong <[email protected]>
1 parent c261946 commit fe26d4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/import-path-resolver.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const importString = `(?:${anyQuote}${pathStringContent}${anyQuote})`;
3737
// Separate patterns for each style of import statement,
3838
// wrapped in non-capturing groups,
3939
// so that they can be strung together in one big pattern.
40-
const funcStyle = `(?:\\b(?:import|require)\\s*\\(\\s*${importString}\\s*\\))`;
40+
const funcStyle = `(?:\\b(?:import|require)\\s*\\(\\s*(\\/\\*.*\\*\\/\\s*)?${importString}\\s*\\))`;
4141
const globalStyle = `(?:\\bimport\\s+${importString})`;
4242
const fromStyle = `(?:\\bfrom\\s+${importString})`;
4343
const moduleStyle = `(?:\\bmodule\\s+${importString})`;

0 commit comments

Comments
 (0)