Registry / testing / cypress-webpack-preprocessor-v5

cypress-webpack-preprocessor-v5

JSON →
library5.0.0-alpha.1jsnpmunverified

A Cypress preprocessor for bundling JavaScript specs via webpack (v5, alpha). Integrates webpack 4.x or 5.x with Cypress's file:preprocessor hook. Requires peer dependencies: @babel/core, @babel/preset-env, babel-loader, webpack. Provides sensible defaults (Babel transpilation, development mode) but allows full customization of webpack options, watchOptions, and additionalEntries. Ships TypeScript types. Not yet stable (alpha); breaking changes may occur. Consider using @cypress/webpack-preprocessor v4 for stable releases.

npm install cypress-webpack-preprocessor-v5
INSTALL
IMPORT
SIG · CYPRESS-WEBPACK-PR
C
cypress-webpack-preprocessor-v5
testingjavascriptv5.0.0-alpha.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ const webpackPreprocessor = require('@cypress/webpack-preprocessor')
✗ const webpackPreprocessor = require('@cypress/webpack-preprocessor').default
CommonJS require; package does not export ES module syntax; use default require.
defaultOptions
✓ const webpackPreprocessor = require('@cypress/webpack-preprocessor'); const defaults = webpackPreprocessor.defaultOptions
✗ import { defaultOptions } from '@cypress/webpack-preprocessor'
ESM import not supported; must use CommonJS require.
Types
✓ import type { CypressWebpackPreprocessorOptions } from '@cypress/webpack-preprocessor'
✗ import { CypressWebpackPreprocessorOptions } from '@cypress/webpack-preprocessor'
Use type import to avoid runtime bundling issues. Types are exported from the package.

Shows typical usage: import the preprocessor, configure webpack options (with Babel preset-env), and hook into Cypress's file:preprocessor event.

// plugins/index.js - Cypress plugins file const webpackPreprocessor = require('@cypress/webpack-preprocessor'); module.exports = (on) => { const options = { webpackOptions: { mode: 'development', module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], }, }, }, ], }, }, watchOptions: {}, }; on('file:preprocessor', webpackPreprocessor(options)); };
Debug
Known issues
breakingVersion 5.0.0-alpha.1 is alpha software; API may change without major version bump.
fix
Use latest stable 4.x version or pin to a specific alpha and test thoroughly.
affects: 5.0.0-alpha.1
breakingwebpack 2 and 3 are not supported; require webpack 4.x or 5.x.
fix
Update webpack to version 4 or 5, or use @cypress/webpack-preprocessor 1.x if webpack 2/3 required.
affects: >=5.0.0-alpha.1
deprecatedBabel 6 not supported; require @babel/core 7.x.
fix
Upgrade to Babel 7, or use @cypress/webpack-preprocessor <= 2.x for Babel 6 support.
affects: >=5.0.0-alpha.1
gotchaThe preprocessor requires Node version bundled with Cypress; using system Node may break.
fix
Set nodeVersion: 'system' in cypress.config.js and ensure Node matches project requirements.
affects: *
gotchaSource maps are always enabled by default; explicit 'devtool: false' required to disable.
fix
Set webpackOptions.devtool = false in options to disable source maps.
affects: *
gotchaPackage does not support ESM imports; must use CommonJS require().
fix
Use const pkg = require('@cypress/webpack-preprocessor') instead of import.
affects: *
Errors
Common errors & fixes
Cannot find module '@babel/core'
Missing peer dependency @babel/core
fix
npm install --save-dev @babel/core @babel/preset-env babel-loader webpack
Error: Cannot find module 'webpack'
Missing peer dependency webpack
fix
npm install --save-dev webpack
TypeError: webpackPreprocessor is not a function
Incorrect import style - used named export instead of default
fix
Use const webpackPreprocessor = require('@cypress/webpack-preprocessor')
Error: You are using a non-standard, unsupported version of webpack.
webpack version < 4
fix
Upgrade webpack to 4.x or 5.x, or downgrade to @cypress/webpack-preprocessor 1.x
Upgrade
Version history
5.0.0-alpha.1latest on npm
Audit
Dependencies
@babel/corerequiredBabel core dependency for transpilation via babel-loader
@babel/preset-envrequiredDefault Babel preset used in webpack configuration
babel-loaderrequiredWebpack loader for Babel transpilation
webpackrequiredBundling engine (4.x or 5.x)
Agent activity
4 hits · last 30 days
node
4
Resources