Registry / testing / jest-webpack-resolver

jest-webpack-resolver

JSON →
library0.3.0jsnpmunverified

Jest plugin that replaces Jest's default module resolution with Webpack's resolver using the project's webpack.config.js. Version 0.3.0 is the latest stable release; the package is no longer actively maintained. It supports Jest >=20 and resolves Webpack features like aliases, extensions, modules, mainFields, and plugins. Unlike manual mocking, it allows Jest to mirror Webpack's resolve behavior automatically.

npm install jest-webpack-resolver
INSTALL
IMPORT
SIG · JEST-WEBPACK-RESOL
J
jest-webpack-resolver
testingjavascriptv0.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
no import needed; set resolver in Jest config
const resolver = require('jest-webpack-resolver');
Not imported directly; configured via Jest's 'resolver' option

Configures Jest to use Webpack resolver with custom webpack config and silent mode.

// package.json { "jest": { "resolver": "jest-webpack-resolver", "jestWebpackResolver": { "webpackConfig": "./webpack.config.js", "silent": true } } } // webpack.config.js module.exports = { resolve: { alias: { Components: './src/components' }, extensions: ['.js', '.jsx'] } }; // Then run: npx jest
Debug
Known issues
breakingjest >=20.0.0 required; older versions lack resolver option
fix
Upgrade Jest to version 20 or later
affects: <20
gotchaWebpack config must export an object or a function returning an object
fix
Ensure webpack.config.js returns a valid webpack configuration
affects: >=0.1.0
deprecatedPackage is no longer actively maintained; consider alternatives like jest-webpack-resolution or custom resolver
fix
Migrate to actively maintained alternatives
affects: >=0.3.0
gotchaThe resolver only supports a single webpack config; multiple configs not supported
fix
Merge configs or use a custom resolver
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'jest-webpack-resolver'
Package not installed or missing from devDependencies
fix
npm install jest-webpack-resolver --save-dev
Configuration error: unknown option 'jestWebpackResolver'
jestWebpackResolver option placed under incorrect key in Jest config
fix
Place jestWebpackResolver at root level of package.json or jest.config
Webpack Resolver using: ./webpack.config.js (not found)
webpackConfig path is incorrect or file does not exist
fix
Ensure webpackConfig points to an existing webpack configuration file
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
jestrequiredPeer dependency, required for resolver hook
Agent activity
6 hits · last 30 days
node
6
Resources
jest-webpack-resolver — npm install jest-webpack-resolver · libregistry