mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-12 18:29:53 -05:00
25 lines
717 B
JavaScript
25 lines
717 B
JavaScript
const { startDevServer } = require('@cypress/webpack-dev-server')
|
|
const getBabelWebpackConfig = require('./getBabelWebpackConfig')
|
|
const { getLegacyDevServer } = require('../utils/legacy-setup-dev-server')
|
|
|
|
function devServer (cypressDevServerConfig, devServerConfig) {
|
|
return startDevServer({
|
|
options: cypressDevServerConfig,
|
|
webpackConfig: getBabelWebpackConfig(cypressDevServerConfig.config, devServerConfig),
|
|
})
|
|
}
|
|
|
|
// Legacy signature
|
|
module.exports = getLegacyDevServer(devServer, (config) => {
|
|
config.env.reactDevtools = true
|
|
|
|
return config
|
|
})
|
|
|
|
// New signature
|
|
module.exports.devServer = devServer
|
|
|
|
module.exports.defineDevServerConfig = function (devServerConfig) {
|
|
return devServerConfig
|
|
}
|