Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transpiled to exports.default instead of module.exports.default #283

Closed
yaquawa opened this issue Apr 6, 2021 · 2 comments
Closed

Transpiled to exports.default instead of module.exports.default #283

yaquawa opened this issue Apr 6, 2021 · 2 comments

Comments

@yaquawa
Copy link

yaquawa commented Apr 6, 2021

I've read https://tsup.egoist.sh/#faq , but it seems like the default behavior is outputting exports.default but not module.exports.default ?

@ElMassimo
Copy link

Related: cjs/esm interoperability patch.

It would be really cool if tsup supported this behavior out of the box, perhaps behind a flag.

@egoist
Copy link
Owner

egoist commented Nov 25, 2021

I've read tsup.egoist.sh/#faq , but it seems like the default behavior is outputting exports.default but not module.exports.default ?

Yeah.

Related: cjs/esm interoperability patch.

It would be really cool if tsup supported this behavior out of the box, perhaps behind a flag.

not sure about that, it's already trivial if you somehow want this:

const mod = require('./dist/index')
module.exports = mod
Object.assign(module.exports, mod)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants