mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-07 15:31:30 -05:00
fix: set correct default when using react-scripts plugin (#20141)
This commit is contained in:
@@ -8,7 +8,7 @@ const devServer = require('@cypress/react/plugins/react-scripts')
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
module.exports = (on, config) => {
|
||||
devServer(on, config)
|
||||
devServer(on, config, {})
|
||||
|
||||
// IMPORTANT to return the config object
|
||||
// with the any changed environment variables
|
||||
|
||||
@@ -7,9 +7,11 @@ const { getTranspileFolders } = require('../utils/get-transpile-folders')
|
||||
const { addFolderToBabelLoaderTranspileInPlace } = require('../utils/babel-helpers')
|
||||
const { reactScriptsFiveModifications, isReactScripts5 } = require('../../dist/react-scripts/reactScriptsFive')
|
||||
|
||||
module.exports = function findReactScriptsWebpackConfig (config, {
|
||||
webpackConfigPath,
|
||||
} = { webpackConfigPath: 'react-scripts/config/webpack.config' }) {
|
||||
module.exports = function findReactScriptsWebpackConfig (config, devServerOptions) {
|
||||
const webpackConfigPath = (devServerOptions && devServerOptions.webpackConfigPath)
|
||||
? devServerOptions.webpackConfigPath
|
||||
: 'react-scripts/config/webpack.config'
|
||||
|
||||
// this is required because
|
||||
// 1) we use our own HMR and we don't need react-refresh transpiling overhead
|
||||
// 2) it doesn't work with process.env=test @see https://github.com/cypress-io/cypress-realworld-app/pull/832
|
||||
|
||||
Reference in New Issue
Block a user