cipchk / ngx-filesaver

Simple file save with FileSaver.js
https://cipchk.github.io/ngx-filesaver/
MIT License
86 stars 18 forks source link

About ES Modules #36

Open Inexad opened 2 years ago

Inexad commented 2 years ago

Hi,

Wouldn't a solution to fix the:

WARNING in node_modules/ngx-filesaver/ivy_ngcc/fesm2015/ngx-filesaver.js depends on file-saver. CommonJS or AMD dependencies can cause optimization bailouts.

To use the package: file-saver-es instead?

cipchk commented 2 years ago

file-saver-es has not been updated for two years and is not recommended; but if you still want to, you can use it like this:

npm install file-saver-es ngx-filesaver --save

But I'm not sure it will work.

In fact, I prefer to configure in angular.json:

"allowedCommonJsDependencies": [
   "file-saver"
],

There is a lot of discussion about ES Modules of file-saver, but nothing seems to be going on:

Inexad commented 2 years ago

I see! I did a bad research before posting. Sorry. Thanks for quick reply.