Skip to content

Commit

Permalink
fix: regex expression
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Jun 22, 2022
1 parent 7b4c4c1 commit 47c190f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const presetFields = Object.freeze({
function transformModuleImports(fileContents: string) {
return fileContents.replace(
/* this regex should hopefully catch all kind of import/export expressions that are relative. */
/((?:import|export)\s+.*\s+from\s+["'])((?:\.\/|\.\.\/)(?:(?!\.js).)+)(["'])/g,
/((?:import|export)\s+[\s\w,{}*]*\s+from\s+["'])((?:\.\/|\.\.\/)(?:(?!\.js).)+)(["'])/g,
(_, importFromPart, modulePath, hyphenEndPart) =>
`${importFromPart}${modulePath}.js${hyphenEndPart}`
);
Expand Down

0 comments on commit 47c190f

Please sign in to comment.