mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
fix(npm/react): webpack config sample bug (#16737)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user