Skip to content

Commit 98fe58c

Browse files
fix(npm/react): webpack config sample bug (#16737)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
1 parent 887f60a commit 98fe58c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

npm/react/docs/recipes.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ If you have your own Webpack config, you can use included plugins file to load i
5959
```js
6060
// cypress/plugins/index.js
6161
module.exports = (on, config) => {
62-
// from the root of the project (folder with cypress.json file)
63-
config.env.webpackFilename = 'webpack.config.js'
64-
require('@cypress/react/plugins/load-webpack')(on, config)
62+
// the path is relative to cypress.json
63+
const webpackFilename = './src/webpack.config.js'
64+
65+
// configuration
66+
config.env.webpackFilename = webpackFilename
67+
config.env.coverage = false
68+
69+
require('@cypress/react/plugins/load-webpack')(on, config, {webpackFilename})
70+
6571
// IMPORTANT to return the config object
6672
// with the any changed environment variables
6773
return config

0 commit comments

Comments
 (0)