country-list
country-list copied to clipboard
Convert project to esm
In this diff I migrated the project to esm and provided module field which is useful for bundlers.
My usecase is rollup. It is able to handle only esm. And this package requires me to add commonjs and json plugins.
As a side bonus this module can be used in browsers without bundlers similar to this https://unpkg.com/jss@next?module.
For tap
I wasn't able to setup esm so I replaced it with tape
.
Hi @fannarsh! What do you think about this change?
Hi @TrySound I'm quite busy at the moment, but I should be able to take a look at this after this weekend.
Friendly ping @fannarsh if you have some time :)
Hi again, if you want I can split migrating to tape in a separate PR for simpler review.
Hi, sorry for the late comment, I got side tracked the other day and forgot to come back to this. The PR itself is fine, thanks for that. But I have decided that I'm not going to convert the project to esm. Although I will look into providing a esm build for it.
(I'm not going to close the PR right away, I might change my mind.)
Let me know if you need to clarify something.
I just found that tap
supports esm out of the box. I reverted tape back to tap.
Any reason this hasn't been merged?
I just searched around and I haven't been able to find an ISO 3166-1-alpha-2 country code package that provides ES modules.
I do think there's an opportunity to provide data like country and language ISO codes but avoid bloating bundle sizes.
@fannarsh: you mentioned you'd take a look at providing an esm
build? In the upcoming Angular 10
there is now a warning against including CommonJS
packages in your dependencies so I'm guessing this issue will get more tracking soon.
Warning message as found in the output of the Angular 10 build:
WARNING in /file.ts depends on country-list. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://web.dev/commonjs-larger-bundles
Any update on this?