{"id":20156,"library":"jest-webpack-resolver","title":"jest-webpack-resolver","description":"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.","status":"maintenance","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/mkg0/jest-webpack-resolver","tags":["javascript"],"install":[{"cmd":"npm install jest-webpack-resolver","lang":"bash","label":"npm"},{"cmd":"yarn add jest-webpack-resolver","lang":"bash","label":"yarn"},{"cmd":"pnpm add jest-webpack-resolver","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency, required for resolver hook","package":"jest","optional":false}],"imports":[{"note":"Not imported directly; configured via Jest's 'resolver' option","wrong":"const resolver = require('jest-webpack-resolver');","symbol":"default","correct":"no import needed; set resolver in Jest config"}],"quickstart":{"code":"// package.json\n{\n  \"jest\": {\n    \"resolver\": \"jest-webpack-resolver\",\n    \"jestWebpackResolver\": {\n      \"webpackConfig\": \"./webpack.config.js\",\n      \"silent\": true\n    }\n  }\n}\n\n// webpack.config.js\nmodule.exports = {\n  resolve: {\n    alias: {\n      Components: './src/components'\n    },\n    extensions: ['.js', '.jsx']\n  }\n};\n\n// Then run: npx jest","lang":"javascript","description":"Configures Jest to use Webpack resolver with custom webpack config and silent mode."},"warnings":[{"fix":"Upgrade Jest to version 20 or later","message":"jest >=20.0.0 required; older versions lack resolver option","severity":"breaking","affected_versions":"<20"},{"fix":"Ensure webpack.config.js returns a valid webpack configuration","message":"Webpack config must export an object or a function returning an object","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Migrate to actively maintained alternatives","message":"Package is no longer actively maintained; consider alternatives like jest-webpack-resolution or custom resolver","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Merge configs or use a custom resolver","message":"The resolver only supports a single webpack config; multiple configs not supported","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install jest-webpack-resolver --save-dev","cause":"Package not installed or missing from devDependencies","error":"Cannot find module 'jest-webpack-resolver'"},{"fix":"Place jestWebpackResolver at root level of package.json or jest.config","cause":"jestWebpackResolver option placed under incorrect key in Jest config","error":"Configuration error: unknown option 'jestWebpackResolver'"},{"fix":"Ensure webpackConfig points to an existing webpack configuration file","cause":"webpackConfig path is incorrect or file does not exist","error":"Webpack Resolver using: ./webpack.config.js (not found)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}