Skip to content

Commit

Permalink
fix: 🐛 do not modify directory import path
Browse files Browse the repository at this point in the history
Signed-off-by: kodai3 <[email protected]>
  • Loading branch information
kodai3 committed Mar 15, 2024
1 parent c980e1b commit fbd7a97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export default defineConfig({

function addMjsExtension(content) {
// This regex looks for relative import paths that don't have a file extension
return content.replace(/from\s+['"](\.\/|\.\.\/)(?![^'"\s]+?\.\w+['"])([^'"\s]+?)['"];/g, "from '$1$2.mjs';");
return content.replace(/from\s+['"](\.\/|\.\.\/)(?![^'"\s]+?\/)['"]([^'"\s]+?)['"];/g, "from '$1$2.mjs';");
}

0 comments on commit fbd7a97

Please sign in to comment.