name
- Type:
optionalname:string
Defined in: options/output-options.ts:378
Specifies the global variable name that contains the exports of umd / iife bundles.
Example
js
export default defineConfig({
output: {
format: 'iife',
name: 'MyBundle',
}
});js
// output
var MyBundle = (function () {
// ...
})();Namespaces are supported i.e., your name can contain dots. The resulting bundle will contain the setup necessary for the namespacing.
js
// output for `name: 'a.b.c'`
this.a = this.a || {};
this.a.b = this.a.b || {};
this.a.b.c = (function () {
// ...
})();