diff --git a/.changeset/chilled-paws-confess.md b/.changeset/chilled-paws-confess.md new file mode 100644 index 00000000..2824711d --- /dev/null +++ b/.changeset/chilled-paws-confess.md @@ -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"`). diff --git a/src/index.js b/src/index.js index 87a9601f..7e1a8ee2 100644 --- a/src/index.js +++ b/src/index.js @@ -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, },