> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# resolve.extensions

> `optional` **extensions?**: `string`\[]

:::info Lynx default override
This is an Rsbuild option whose default is overridden by `pluginLynx`. The default shown below applies when using the plugin. Set this option at the top level of `rsbuild.config.ts`; an explicit value takes precedence.

[See the Rsbuild reference for the full option behavior](https://rsbuild.rs/config/resolve/extensions).
:::

Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.

## Default Value

`['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']`

## Remarks

For example, if importing './index', Rsbuild will try to resolve using the following order:

- `./index.ts`

- `./index.tsx`

- `./index.mjs`

- `./index.js`

- `./index.jsx`

- `./index.json`

- `./index.cjs`

The difference between `resolve.extensions` and `tools.rspack.resolve.extensions`:

`resolve.extensions`: Replaces the default list; `pluginLynx` still appends `.cjs`.

`tools.rspack.resolve.extensions`: Merges with the default configuration using [`webpack-merge`](https://github.com/survivejs/webpack-merge).

## Example

```js
export default {
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
  },
}
```
