Clarify how to specify UMD export name #10
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
name
option to the CLI, which accepts a string.Context
When bundling UMD build, it is often useful to control the export name. For instance, microbundle defaults to a snake_case version of the
name
field inpackage.json
, but camelCase is generally preferred in JavaScript. Trying do so myself, I noticed the line that determines the name feeds from two additional sources:options.name
which seems like it comes from the CLI options, but no such options existspkg.amdName
which is not a standard field AFAIK or mentioned in the READMEThis PR intends to fix both those things. 🙂
It's worth noting that adding
--name
from the CLI already feeds tooptions.name
. This just makes that fact official, rather than implicit.