Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECMAScript module (ESM) bundle support #140

Open
2 of 6 tasks
LoganDupont opened this issue Sep 7, 2020 · 0 comments
Open
2 of 6 tasks

ECMAScript module (ESM) bundle support #140

LoganDupont opened this issue Sep 7, 2020 · 0 comments

Comments

@LoganDupont
Copy link

Type:

  • bug
  • feature
  • enhancement
  • question

Environment:

  • OS: /
  • Browser: /
  • Library Version: 1.2.1

I'm going to open a PR:

  • yes
  • no

Description:
Currently using leaflet-ant-path in an Angular version 10+ application gives the following build warning:

WARNING in [filename] depends on 'leaflet-ant-path'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

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’ve started seeing these warnings for your dependencies, let your dependency know that you’d 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

Is it possible to add ESM support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant