You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 using npm 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:
Importing minified version in CRA fixes the issue.
I went from:
import p from 'image-blob-reduce';
const pica = p();
to:
import type { ImageBlobReduceStatic } from 'image-blob-reduce';
// @ts-ignore
import p from 'image-blob-reduce/dist/image-blob-reduce.min.js';
const pica = (p as ImageBlobReduceStatic)();
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: