Skip to content

Commit

Permalink
Merge branch 'fix/cypress-react-webpack-path' of https://github.com/c…
Browse files Browse the repository at this point in the history
…ypress-io/cypress into fix/cypress-react-webpack-path
  • Loading branch information
lmiller1990 committed Jun 4, 2021
2 parents 0a6e418 + 4302583 commit b6d6e5a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions npm/react/docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ If you have your own Webpack config, you can use included plugins file to load i
```js
// cypress/plugins/index.js
module.exports = (on, config) => {
// from the root of the project (folder with cypress.json file)
config.env.webpackFilename = 'webpack.config.js'
require('@cypress/react/plugins/load-webpack')(on, config)
// the path is relative to cypress.json
const webpackFilename = './src/webpack.config.js'

// configuration
config.env.webpackFilename = webpackFilename
config.env.coverage = false

require('@cypress/react/plugins/load-webpack')(on, config, {webpackFilename})

// IMPORTANT to return the config object
// with the any changed environment variables
return config
Expand Down

0 comments on commit b6d6e5a

Please sign in to comment.