-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ES Modules support #538
Comments
Good idea. It not work. |
Currently using file-saver in an Angular version 10+ application gives the following build warning:
Starting with Angular 10 the Angular CLI now provide warnings for CommonJS modules. Read more about it here:
And here:
|
Hello, I reached this issue by looking for any solution for the Angular 10 warnings (CommonJS or AMD dependencies can cause optimization bailouts.), rather that simply ignore them by configuring allowedCommonJsDependencies in angular.json. Is there any plan to build file-saver as ECMAScript module and make Angular happy? |
Any news about this? |
Same here, would love to see this resolved... |
file-saver-es worked for me for now, im happy. |
@ulisesmorenomassachusetts thanks! I was sure I searched for it and it wasn't updated recently... I might be confusing with another library probably. Thanks for the input! :-) |
To summarize my changes:
It would be nice to simply include the typings of this library inside this repository and reduce the need to install |
@HarelM Thanks for sharing! I tried to do the same but I'm getting: ERROR in ./src/app/services/export.service.ts 29:8-17 Anyone else running into the same issue? |
My import statement is not using the default but rather the following: |
I thought I'd tried that as well yesterday with the same error but I tried again and you're right it works ! Thanks a lot! |
there is an issue when setting |
just add "allowedCommonJsDependencies": [ into Angular.json https://angular.io/guide/build#configuring-commonjs-dependencies |
Any news? |
I used this way. But still gave me [ERROR] TS7016: Could not find a declaration file for module 'file-saver-es'. |
Here in step 4 you are reusing the typescript type definitions from the file-saver npm package for file-saver-es. It works, but there's a more elegant solution. You can simply replace the npm package |
Any plan to support ES modules?
Basically all that is required is
at the end, similarly to the module.exports today.
This could also be stripped (if deemed necessary) when compiling the dist output.
The text was updated successfully, but these errors were encountered: