From 98fe58cce3dd42fc6ca4616a9ed3c9da7b33794c Mon Sep 17 00:00:00 2001 From: Shunfang Lan Date: Fri, 4 Jun 2021 07:22:28 -0700 Subject: [PATCH] fix(npm/react): webpack config sample bug (#16737) Co-authored-by: Lachlan Miller --- npm/react/docs/recipes.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/npm/react/docs/recipes.md b/npm/react/docs/recipes.md index 4e6e70176837..a3a33a39e67d 100644 --- a/npm/react/docs/recipes.md +++ b/npm/react/docs/recipes.md @@ -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