Cypress preprocessor for bundling JavaScript via rollup
npm install cypress-rollup-preprocessor!Build



> Cypress preprocessor for bundling JavaScript via rollup

First install node.js. Then:
``sh`
npm install cypress-rollup-preprocessor --save-dev
This package relies on the following peer dependencies:
- rollup
It is likely you already have these installed either directly or as a transient
dependency, but if not, you will need to install them.
`sh`
npm install --save-dev rollup
This version is only compatible with rollup 2.x+
Check Cypress' official documentation about preprocessors
`javascript
import { defineConfig } from 'cypress'
import rollupPreprocessor from 'cypress-rollup-preprocessor'
export default defineConfig({
e2e: {
setupNodeEvents (on, config) {
on('file:preprocessor', rollupPreprocessor())
},
},
})
`
`javascript
const rollupPreprocessor = require("cypress-rollup-preprocessor");
module.exports = (on) => {
on("file:preprocessor", rollupPreprocessor());
};
`
- Cypress >= 10
- Cypress <= 9
- Using Rollup config with Typescript
Pass in options as the argument to rollup:
`javascript
import rollupPreprocessor from 'cypress-rollup-preprocessor'
// Using the options from rollup.config.js
import rollupConfig from '
const { output: outputOptions, ...inputOptions } = rollupConfig
// ...
on('file:preprocessor', rollupPreprocessor({ inputOptions, outputOptions }))
// ...
`
Object of rollup input options. You can just require in the options from yourrollup.config.js to use the same options as your app.
Reference:
Object of rollup output options.
Reference:
Please read the Contributing guidelines.
To run tests, first install nodeunit and any dependencies via npm:
`sh`
npm ci
Run tests with:
`sh``
npm test
Many approaches, patterns and standards were copied from:
-
-
-
This project is licensed under the terms of the MIT license.