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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ Not imported; configured via package.json jest.scriptPreprocessor
✗ import webpackBabelJest from 'webpack-babel-jest';
This is a preprocessor script, not a module you import directly.
scriptPreprocessor
✓ jest.scriptPreprocessor = '<rootDir>/node_modules/webpack-babel-jest';
✗ scriptPreprocessor: require('webpack-babel-jest')
Must be a string path, not a module reference.
Shows typical package.json configuration for using this preprocessor with Jest.
// package.json
{
"devDependencies": {
"webpack-babel-jest": "*",
"jest-cli": "*"
},
"scripts": {
"test": "jest"
},
"jest": {
"scriptPreprocessor": "<rootDir>/node_modules/webpack-babel-jest",
"testFileExtensions": ["es6", "js"],
"moduleFileExtensions": ["js", "json", "es6"]
}
}
Errors
Common errors & fixes
Could not find module 'webpack-babel-jest' from 'rootDir'
Incorrect path or module not installed in project root.
fixInstall locally: npm install --save-dev webpack-babel-jest; check node_modules path.
Cannot find module 'babel-jest'
babel-jest is a required peer dependency not installed.
fixInstall babel-jest: npm install --save-dev babel-jest
Audit
Dependencies
babel-jestrequiredCore dependency for Babel transformation