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

# Resolver API

Rspack uses the higher-performance [rspack-resolver](https://github.com/rstackjs/rspack-resolver) written in Rust to replace webpack's [enhanced-resolve](https://github.com/webpack/enhanced-resolve), and experimentally re-exports these APIs through `rspack.experiments.resolver`. This allows you to directly call rspack-resolver's functions like `resolver.sync` or `resolver.async`.

For complete usage and options, see [rspack-resolver](https://github.com/rstackjs/rspack-resolver). Below is a simple example demonstrating how to use Rspack to resolve module paths:

```js
import { rspack } from '@rspack/core';

const { resolver } = rspack.experiments;

// Directly use Resolver API with default options
const { path: syncResolvedPath } = resolver.sync(contextPath, './index.js');
const { path: asyncResolvedPath } = await resolver.async(
  contextPath,
  './index.js',
);

// Use ResolverFactory with custom options
const customResolver = new resolver.ResolverFactory(resolveOptions);
const syncResult = customResolver.sync(contextPath, './request.js');
const asyncResult = await customResolver.async(contextPath, './request.js');
```
