Skip to content

Commit 9b967e0

Browse files
authored
fix: set correct default when using react-scripts plugin (#20141)
1 parent e709184 commit 9b967e0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

npm/react/examples/react-scripts/cypress/plugins/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const devServer = require('@cypress/react/plugins/react-scripts')
88
* @type {Cypress.PluginConfig}
99
*/
1010
module.exports = (on, config) => {
11-
devServer(on, config)
11+
devServer(on, config, {})
1212

1313
// IMPORTANT to return the config object
1414
// with the any changed environment variables

npm/react/plugins/react-scripts/findReactScriptsWebpackConfig.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ const { getTranspileFolders } = require('../utils/get-transpile-folders')
77
const { addFolderToBabelLoaderTranspileInPlace } = require('../utils/babel-helpers')
88
const { reactScriptsFiveModifications, isReactScripts5 } = require('../../dist/react-scripts/reactScriptsFive')
99

10-
module.exports = function findReactScriptsWebpackConfig (config, {
11-
webpackConfigPath,
12-
} = { webpackConfigPath: 'react-scripts/config/webpack.config' }) {
10+
module.exports = function findReactScriptsWebpackConfig (config, devServerOptions) {
11+
const webpackConfigPath = (devServerOptions && devServerOptions.webpackConfigPath)
12+
? devServerOptions.webpackConfigPath
13+
: 'react-scripts/config/webpack.config'
14+
1315
// this is required because
1416
// 1) we use our own HMR and we don't need react-refresh transpiling overhead
1517
// 2) it doesn't work with process.env=test @see https://github.com/cypress-io/cypress-realworld-app/pull/832

0 commit comments

Comments
 (0)