---
url: /reference/api/Interface.DepsConfig.md
---
# Interface: DepsConfig

Defined in: [src/features/deps.ts:45](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L45)

## Properties

### alwaysBundle?

```ts
alwaysBundle?:
  | Arrayable<string | RegExp>
  | NoExternalFn;
```

Defined in: [src/features/deps.ts:64](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L64)

Force dependencies to be bundled, even if they are in `dependencies`, `peerDependencies`, or `optionalDependencies`.

***

### dts?

```ts
dts?: Pick<DepsConfig, "alwaysBundle" | "neverBundle">;
```

Defined in: [src/features/deps.ts:98](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L98)

Override dependency bundling options for declaration file generation.

***

### neverBundle?

```ts
neverBundle?:
  | true
  | string | RegExp | (string | RegExp)[] | ExternalOptionFunction;
```

Defined in: [src/features/deps.ts:60](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L60)

Mark dependencies as external (not bundled).
Accepts strings, regular expressions, or Rolldown's
`ExternalOption`.

Set to `true` to externalize **all** dependencies: every import that
follows npm package naming conventions is marked as external as written,
without resolving it. Other non-relative imports (e.g. `#` subpath
imports and path aliases like `~/`) are resolved, and kept external
only if they resolve into `node_modules`; otherwise the resolved local
file is bundled.

Use [`alwaysBundle`](#alwaysbundle) to opt specific imports back into the bundle.

***

### onlyBundle?

```ts
onlyBundle?: false | Arrayable<string | RegExp>;
```

Defined in: [src/features/deps.ts:75](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L75)

Whitelist of dependencies allowed to be bundled from `node_modules`.
Throws an error if any unlisted dependency is bundled.

* `undefined` (default): Log an info-level hint if any `node_modules`
  dependencies are bundled.
* `false`: Disable the hint and all checks about bundled dependencies.

Note: Be sure to include all required sub-dependencies as well.

***

### onlyImport?

```ts
onlyImport?: Arrayable<string | RegExp>;
```

Defined in: [src/features/deps.ts:86](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L86)

Whitelist of packages that the emitted output is allowed to import.
Matched against the package name, so subpath imports (e.g. `cac/deno`)
are covered by listing the package (e.g. `cac`).
Node built-in modules are always allowed to be imported
when `platform` is `node`.

Note: ES imports and dynamic import expressions are checked. CJS
`require` calls are not detected.

***

### resolveDepSubpath?

```ts
resolveDepSubpath?: boolean;
```

Defined in: [src/features/deps.ts:93](https://github.com/rolldown/tsdown/blob/4e612b53c3ee410664a4a421e66c7f9ab70e15cc/src/features/deps.ts#L93)

Resolve dependency subpath imports to their actual package-relative paths
when externalizing packages without an `exports` field.

#### Default

```ts
false
```
