Skip to content

Commit 086e10b

Browse files
authored
Merge pull request #10 from msfragala/umd-name-option
Clarify how to specify UMD export name
2 parents f50cada + 0fcbd49 commit 086e10b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Microbundle includes two commands - `build` (the default) and `watch`. Neither r
4141
### `microbundle` / `microbundle build`
4242

4343
By default, microbundle will infer the location of your source entry file
44-
(the root module in your program) from the `module` field in your `package.json`. It will infer the output directory and filename(s) from the `main` field.
44+
(the root module in your program) from the `module` field in your `package.json`. It will infer the output directory and filename(s) from the `main` field. For UMD builds, microbundle will use a snake case version of the `name` field in your `package.json` for the export name; you can also specify a name via an `amdName` field or the `name` CLI option.
4545

4646
### `microbundle watch`
4747

@@ -72,6 +72,7 @@ Options:
7272
[boolean] [default: true]
7373
--strict Enforce undefined global context and add "use
7474
strict" [default: false]
75+
--name Specify name exposed in UMD builds [string]
7576
```
7677

7778

src/cli.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ yargs
3636
description: 'Enforce undefined global context and add "use strict"',
3737
default: false
3838
})
39+
.option('name', {
40+
description: 'Specify name exposed in UMD builds',
41+
default: false
42+
})
3943
.command(
4044
['build [entries..]', '$0 [entries..]'],
4145
'Build once and exit',

0 commit comments

Comments
 (0)