Skip to content

Commit

Permalink
fix(rollup): stub esm with jiti for typescript support
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 20, 2021
1 parent 909a539 commit 6bab21f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builder/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function rollupBuild (ctx: BuildContext) {
for (const entry of ctx.entries.filter(entry => entry.builder === 'rollup')) {
const output = resolve(ctx.rootDir, ctx.outDir, entry.name)
await writeFile(output + '.cjs', `module.exports = require('jiti')()('${entry.input}')`)
await writeFile(output + '.mjs', `export * from '${entry.input}'`)
await writeFile(output + '.mjs', `import jiti from 'jiti';\nexport default jiti()('${entry.input}');`)
await writeFile(output + '.d.ts', `export * from '${entry.input}'`)
}
return
Expand Down

0 comments on commit 6bab21f

Please sign in to comment.