const webpackPreprocessor = require('@cypress/webpack-preprocessor'); module.exports = (on, config) => { const options = { webpackOptions: { output: { chunkFormat: 'commonjs', }, target: 'node', }, }; on('file:preprocessor', webpackPreprocessor(options)); };