---
url: /reference/OutputOptions.globals.md
---
# globals

* **Type**: `Record`<`string`, `string`> | ((`name`) => `string`)
* **Optional**

Specifies `id: variableName` pairs necessary for [external](Interface.InputOptions.md#external) imports in `umd` / `iife` [formats](./OutputOptions.format).

## Example

```js
export default defineConfig({
  external: ['jquery'],
  output: {
    format: 'iife',
    name: 'MyBundle',
    globals: {
      jquery: '$',
    }
  }
});
```

```js
// input
import $ from 'jquery';
```

```js
// output
var MyBundle = (function ($) {
  // ...
})($);
```
