diff --git a/src/builder/rollup.ts b/src/builder/rollup.ts index 866d57f5..b2c1541c 100644 --- a/src/builder/rollup.ts +++ b/src/builder/rollup.ts @@ -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')(null, { interopDefault: true })('${entry.input}')`) - await writeFile(output + '.mjs', `import jiti from 'jiti';\nexport default jiti()('${entry.input}');`) + await writeFile(output + '.mjs', `import jiti from 'jiti';\nexport default jiti(null, { interopDefault: true })('${entry.input}');`) await writeFile(output + '.d.ts', `export * from '${entry.input}'`) } return