moberwasserlechner / capacitor-filesharer

Capacitor plugin to download and share files for the Web, Android and iOS! Stop the war in Ukraine!
MIT License
82 stars 20 forks source link

Feat: Replace file-sharer dependency for file-sharer-es in order to reduce bundle size #37

Closed diegomrivero closed 1 year ago

diegomrivero commented 2 years ago

Describe the Feature

Using capacitor-filesharer in an Angular application produces the following output during the building process:

...\@byteowls\capacitor-filesharer\dist\esm\web.js depends on 'file-saver'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

This is because there is a dependency on file-sharer which uses the CommonJS syntax.

Platform(s) Support Requested

Describe Preferred Solution

Replace the dependency of file-sharer to file-sharer-es in order to use ES modules syntax.

Describe Alternatives

None

Related Code

None

Additional Context

None

moberwasserlechner commented 1 year ago

I tried it with file-saver-es but it broke the build. I'm happy to accept a PR but please test it as I have no time to do it.

moberwasserlechner commented 1 year ago

As no PR was made I'm closing this. Feel free to provide a PR.