-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support --format=
when without bundle
#109
Comments
It's a good idea. I've been planning to do this but haven't gotten to it yet. It should be fairly straightforward. However, the whole bundling transform is currently being rewritten to support tree shaking and code splitting. So I'm going to wait to do this until after that is done. |
Any updates on the |
I just landed a change that implements this. There are some details in the release notes. I decided to not implement CommonJS to ECMAScript module conversion for now. There are a few different options and it's not immediately clear to me how to implement it. I'm not sure if there's a single way to implement it that would satisfy all use cases, or even what the majority use case is. Some of my open questions:
Anyway, CommonJS to ECMAScript module conversion seems sufficiently complex and full of pitfalls that it looks like it isn't something that belongs in esbuild's core to me. At least not until I have more data. |
@evanw when will this feature be released? |
Sometime later tonight. I recently discovered some unrelated correctness issues that I want fix too. |
It has now been released as version 0.6.32. Please let me know if you encounter any issues. |
First of all, this is an incredible project. I'm really impressed with the speed!
I'm trying to run
esbuild --format=cjs add.js
onBut the output is
Is this intended? Or should it only work with
--bundle
?My use case is that I'm looking for a quick transformer that can transform an esmodule to commonjs, I'm wondering if esbuild could do something like this.
The text was updated successfully, but these errors were encountered: