ai / dual-publish

Publish JS project as dual ES modules and CommonJS package to npm
MIT License
187 stars 11 forks source link

Support "development" and "production" conditions #14

Closed guybedford closed 3 years ago

guybedford commented 3 years ago

Just like .browser is automatically detected it would be nice to automatically detect .browser.development to mean the "browser": { "development" } exports entry.

If there were eg both a index.browser.js and index.browser.development.js then it would infer "browser": { "development", "default" }.

This would then enable https://github.com/ai/nanoid/issues/237#issuecomment-703135919.

ai commented 3 years ago

Let’s do index.dev.js and index.browser.dev.js

guybedford commented 3 years ago

It could even be nice to dynamically split on the . characters and have a well defined grammar mapping in general to allow full flexibility.

(But with so few combinations right now handling them explicitly works too of course!)

ai commented 3 years ago

Completely have no time for this issue.

Will be glad for PR.

ai commented 3 years ago

Fixed in https://github.com/ai/dual-publish/pull/16 by @AleksandrSl