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

exports changed between 4.6.0 and 4.7.0 #321

Closed
JounQin opened this issue Nov 19, 2021 · 5 comments
Closed

exports changed between 4.6.0 and 4.7.0 #321

JounQin opened this issue Nov 19, 2021 · 5 comments
Labels

Comments

@JounQin
Copy link
Contributor

JounQin commented Nov 19, 2021

image

https://unpkg.com/browse/rollup-plugin-esbuild@4.7.0/dist/index.js

// previous
const esbuild = require('rollup-plugin-esbuild')
import esbuild from 'rollup-plugin-esbuild' // native ESM also works

esbuild({})

However, the above codes will just error after upgrading to 4.7.0, I don't know how to write correct codes with native ESM and TypeScript at the same time now. :(

Maybe it's time to publish this package as cjs/esm both.

@JounQin
Copy link
Contributor Author

JounQin commented Nov 19, 2021

cc @privatenumber

@egoist egoist closed this as completed in 7daf8f6 Nov 19, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 4.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JounQin
Copy link
Contributor Author

JounQin commented Nov 19, 2021

@egoist
Copy link
Owner

egoist commented Nov 19, 2021

you should just use require('rollup-plugin-esbuild').default if using the cjs build

@JounQin
Copy link
Contributor Author

JounQin commented Nov 19, 2021

// Annotate the CommonJS export names for ESM import in node:
0 &&
  (module.exports = {
    minify,
  })

Sorry, I just noticed 0 && what means the following module.exports = will never be executed.

The generated codes are a bit strange. 🤣

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

No branches or pull requests

2 participants