Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set correct default when using react-scripts plugin #20141

Merged
merged 1 commit into from Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion npm/react/examples/react-scripts/cypress/plugins/index.js
Expand Up @@ -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, {})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests that if a {} is passed, it will still work.


// IMPORTANT to return the config object
// with the any changed environment variables
Expand Down
Expand Up @@ -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
Expand Down