Skip to content

Commit

Permalink
fix: set default webpack path if empty config object provided
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Feb 10, 2022
1 parent e709184 commit ab771dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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, {})

// 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

0 comments on commit ab771dd

Please sign in to comment.