-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Using esbuild instead of Rollup fixes known terser bug #39
Comments
I've found that forcing source version by using |
Importing minified version in CRA fixes the issue. I went from:
to:
|
@nktka I get the following error when I try the solution that you suggest above
Any ideas how I might circumvent this? I tried updating my terser config as suggested in the |
@Gkleinereva that solution is for "create react app" so not applicable in your case. I'm sorry. |
@nktka Thanks for your response :) For future explorers, I eventually ended up implementing the workaround documented at #17 (comment), which worked just fine! |
Hello @puzrin, locally I tried to build this library with esbuild instead of Rollup and this fixed the known issue with terser. Would you be interested in a PR to change the build from Rollup to esbuild?
Locally I built the ESM version with esbuild by issuing this command:
npx esbuild index.js --bundle --format=esm --outfile=dist/image-blob-reduce.esm.mjs
and by usingnpm link
I could try it out on a local project which is suffering from the terser bug, but as said with the esbuild version this bug did not appear.The only problem with changing bundlers is that there could be other subtle problems coming up, but in my limited testing with the ESM version it was working just fine. But maybe you have more projects (best would be CJS projects) to test some new bundled versions.
Update: I saw that esbuild does not generate UMD bundles, so maybe these should be generated by Rollup like before. And just the ESM bundle which is also exported by the
package.json
will be generated by esbuild.The text was updated successfully, but these errors were encountered: