Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's what it does. The reason it does this is because npm modules distributed using the "modern" (as in recently added) module system can be more efficiently distributed to users by allowing you to only import parts of a package that you actually use.

The reason not all packages support this, besides legacy, is that this also requires your runtime environment to support and benefit from this. In other words, this is useful when you're targeting modern browsers. When a package can potentially also be used in Node projects, or projects that require support for relatively widely used browsers such as Internet Explorer, however, supporting this module system might not be possible or worth the effort.

In other words, it has absolutely nothing to do with it being too easy to publish to npm.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: