Skip to content

Conversation

msfragala
Copy link
Contributor

What this does

  • Adds a name option to the CLI, which accepts a string.
  • Briefly discusses options for specifying UMB export names in the README

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 in package.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 exists
  • pkg.amdName which is not a standard field AFAIK or mentioned in the README

This PR intends to fix both those things. 🙂

It's worth noting that adding --name from the CLI already feeds to options.name. This just makes that fact official, rather than implicit.

Copy link
Owner

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

@developit developit merged commit 086e10b into developit:master Dec 13, 2017
@developit
Copy link
Owner

FWIW I would like to also switch the default name generation to use camelCase instead of snake_case.

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

Successfully merging this pull request may close these issues.

2 participants