mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
26 lines
777 B
JavaScript
26 lines
777 B
JavaScript
const { startDevServer } = require('@cypress/webpack-dev-server')
|
|
const { createWebpackDevConfig } = require('@craco/craco')
|
|
const { getLegacyDevServer } = require('../utils/legacy-setup-dev-server')
|
|
|
|
function devServer (cypressDevServerConfig, cracoConfig) {
|
|
process.env.FAST_REFRESH = 'false'
|
|
|
|
return startDevServer({
|
|
options: cypressDevServerConfig,
|
|
webpackConfig: createWebpackDevConfig(cracoConfig),
|
|
})
|
|
}
|
|
|
|
// Legacy signature
|
|
module.exports = getLegacyDevServer(devServer, (config) => {
|
|
config.env.reactDevtools = true
|
|
|
|
return config
|
|
})
|
|
|
|
// New signature
|
|
// - Note that this also includes a change to the second argument!
|
|
module.exports.devServer = (cypressDevServerConfig, { cracoConfig }) => {
|
|
return devServer(cypressDevServerConfig, cracoConfig)
|
|
}
|