diff --git a/tsup.config.ts b/tsup.config.ts index 60029d7..bd5bc87 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -16,6 +16,7 @@ export default defineConfig({ renderChunk(_, { code }) { if (this.format === 'cjs') { const regex = /require\("(?\.\/.+)"\)/g; + // TODO: should do nothing if file already ends in .cjs return { code: code.replace(regex, "require('$.cjs')") }; } },