matheusdavidson / angular-cropperjs

CropperJS integration for Angular +6
MIT License
109 stars 69 forks source link

Getting CommonJS or AMD dependencies can cause optimization bailouts #87

Closed motohead400 closed 10 months ago

motohead400 commented 10 months ago

It looks like this module should be importing cropperjs via

import Cropper from 'cropperjs/dist/cropper.esm.js'; https://github.com/fengyuanchen/cropperjs/issues/1010

matheusdavidson commented 10 months ago

Hi, to fix that warning you should add cropperjs to allowedCommonJsDependencies in your angular.json:

https://bobbyhadz.com/blog/angular-commonjs-or-amd-dependencies-can-cause-optimization-bailouts#adding-the-package-to-allowedcommonjsdependencies-in-angularjson

meanwhile I’ll investigate the benefits of using the esm build

motohead400 commented 10 months ago

Hello, that just removes the warning but doesn't fix the problem. As it states, dependencies on commonjs cause optimization bailouts, so that dependency will cause a much larger package.

motohead400 commented 8 months ago

Hi, any word on this?