Foliotek / Croppie

A Javascript Image Cropper
http://foliotek.github.io/Croppie
MIT License
2.56k stars 885 forks source link

Feature request - Please add support for ES2015 #727

Open mehmetgunacti opened 4 years ago

mehmetgunacti commented 4 years ago

It seems that current version of Croppie is available as CommonJS module only.

Google suggests avoiding the use of CommonJS modules since it impacts the tree-shaking of application. Ref: https://web.dev/commonjs-larger-bundles/

I would, therefore, request you to please release this package as an ES2015 module as well.

Thank you

Angular project warnings :

WARNING in /home/.../Projects/angular-library/library/dist/lib/... depends on croppie.
CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Timebutt commented 4 years ago

Ever since Angular 10 came out this will be a warning that is thrown for a lot of applications (mine included). Would be great seeing ES modules artifacts in the croppie package. I might have a look at changing the current build configuration for this if I find the time 👌

theodorejb commented 6 months ago

I developed a simplified fork named Cropt which is written in TypeScript and published as a native ES module. It also has a higher quality image scaling algorithm and numerous other improvements. https://github.com/theodorejb/cropt