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

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

Maps [external](Interface.InputOptions.md#external) module IDs to paths.

Allows customizing the path used when importing external dependencies.
This is particularly useful for loading dependencies from CDNs or custom locations.

* Object form: Maps module IDs to their replacement paths
* Function form: Takes a module ID and returns its replacement path

## Examples

```js
{
  paths: {
    'd3': 'https://cdn.jsdelivr.net/npm/d3@7'
  }
}
```

```js
{
  paths: (id) => {
    if (id.startsWith('lodash')) {
      return `https://cdn.jsdelivr.net/npm/${id}`
    }
    return id
  }
}
```
