Sheet.js is providing the following warning in the Angular CLI for the new v10 release:

Starting with Angular 10 the Angular CLI now provide warnings for CommonJS modules. Read more about it here:
https://blog.angular.io/version-10-of-angular-now-available-78960babd41
When you use a dependency that is packaged with CommonJS, it can result in larger slower applications.
Starting with version 10, we now warn you when your build pulls in one of these bundles. If you鈥檝e started seeing these warnings for your dependencies, let your dependency know that you鈥檇 prefer an ECMAScript module (ESM) bundle.
And here:
https://angular.io/guide/build#configuring-commonjs-dependencies
It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application. For more information, see How CommonJS is making your bundles larger
They reference the following article regarding the issues with CommonJS:
https://web.dev/commonjs-larger-bundles/
Additionally I've seen a few discussions by Angular staff members on Github discussing potentially dropping CommonJS support by default, and making it an opt-in feature in the future.
I realize the Angular team is taking a very strong armed approach here, but their reasoning seems solid. Needless to say I'd love to see ESM support if possible. Thanks!
CommonJS requires no language changes and thus is compatible with older IE and other environments like PhotoShop extensions. ESM breaks older browsers and legacy environments with the introduction of the new export keyword. While Google and the Angular team may be quick to "move fast and break things", we'd prefer not to.
That said, is there some stopgap measure? Can we create a dummy index.mjs file that imports the standalone packaged dist script? We could also generate a script that just concatenates the dist script with "export default XLSX;"
Yep, I understand the goal is wide support, but the stopgap solution you've suggested seems reasonable to me!
Was this issue solved? I work with Angular as well :)
@SheetJSDev what needs to be done to get any of those two stopgap measures done?
Would it be possible to publish the dist script concatenated with the default export as a separate package or..?
I beleive you should still have a version with ECMAScript.
I'm running into this same issue. The resulting file is very large (725kB) and slow. If we could get this working as an ES module, it would help a lot.
Any advance on this?
Most helpful comment
I'm running into this same issue. The resulting file is very large (725kB) and slow. If we could get this working as an ES module, it would help a lot.