Cypress Add multiple function/event on plugins/index.js on file preprocessor

How can I add multiple events on file:preprocessor?
I’m struggling to have the webpack plugin and cypress-select-tests plugin on file:prep

I tried below but it will just process the last one.

const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor');
const selectTestsWithGrep = require('cypress-select-tests/grep')
module.exports = (on, config) => {

on('file:preprocessor', cypressTypeScriptPreprocessor);
on('file:preprocessor', selectTestsWithGrep(config));

Also, did like below and still to no avail.

const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor');
const selectTestsWithGrep = require('cypress-select-tests/grep')
module.exports = (on, config) => {
on('file:preprocessor', { cypressTypeScriptPreprocessor, , selectTestsWithGrep(config)});

Any inputs are much appreciated.
Thanks.

38 thoughts on “Cypress Add multiple function/event on plugins/index.js on file preprocessor”

Leave a Comment