mirror of
https://github.com/developit/microbundle.git
synced 2026-01-18 13:56:35 +00:00
Support global extend via amdName (#713)
* Support global extend via amdName
Using a prefixed name like `{ "amdName": "global.foo" }` will trigger Rollup's `output.extend` option. This addresses the use-case from #709 without adding another CLI flag.
* Create chilled-paws-confess.md
* Update chilled-paws-confess.md
This commit is contained in:
parent
d08f977aa6
commit
ffcc9d9b7d
5
.changeset/chilled-paws-confess.md
Normal file
5
.changeset/chilled-paws-confess.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"microbundle": patch
|
||||
---
|
||||
|
||||
Support [extending a UMD global](https://rollupjs.org/guide/en/#outputextend) by prefixing the package.json `"amdName"` field (eg: `"global.xyz"`).
|
||||
@ -590,7 +590,8 @@ function createConfig(options, entry, format, writeMeta) {
|
||||
return shebang[options.name];
|
||||
},
|
||||
format: modern ? 'es' : format,
|
||||
name: options.name,
|
||||
name: options.name && options.name.replace(/^global\./, ''),
|
||||
extend: /^global\./.test(options.name),
|
||||
dir: outputDir,
|
||||
entryFileNames: outputEntryFileName,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user