-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Normalize DevServer Config Resolution #24133
Comments
Hey team! Please add your planning poker estimate with Zenhub @amehta265 @astone123 @lmiller1990 @marktnoonan @mike-plummer @rockindahizzy @warrensplayer @ZachJW34 |
Just noting from the sync with Brian last Wednesday, we have agreed that
and that that is the plan for this ticket. It should come with warnings for Vite users. My suggestion for the vite warnings is to use our existing alert pattern in the app at the top of the specs list, so there’s one place to surface the error, and it’s definitely in the path of the user opening a spec. We would persist their dismissal of the alert in saved state. When tests are run from the terminal, we would also print a warning to Vite users that config resolution has changed. The text for both warnings would be something like:
|
@marktnoonan for run mode, is the warning always displayed or displayed only once? When do we stop showing the warning? |
The code for this is done in cypress-io/cypress#24369, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
The config resolution for
@cypress/webpack-dev-server
and@cypress/vite-dev-server
differ.@cypress/vite-dev-server
will always source a<project-root>/vite.config.js
and merge the properties with thedevServer.viteConfig
value if supplied.@cypress/webpack-dev-server
will only source a<project-root>/webpack.config.js
if and only ifdevServer.webpackConfig
is undefined.Desired behavior
The config resolution should be equivalent across dev-servers. I'd argue the
@cypress/webpack-dev-server
is the proper config resolution, as it allows the user to opt out of Cypress trying to merge in their project root config (which might be a config they don't want to use for CT testing).Test code to reproduce
Run
DEBUG=cypress:vite-dev-server:resolve-config npx cypress open
on a Vite based project that has a<project-root>/vite.config.js
. Look in the terminal after clicking on CT testing in the launchpad and the resolved config will be logged. Close Cypress and edit thecypress.config.js -> component.devServer.viteConfig
property (add a plugin, change port). The changes made will be merged with the properties defined in<project-root>/vite.config.js
.Run
DEBUG=cypress:webpack-dev-server:makeWebpackConfig npx cypress open
on a Webpack based project that has a<project-root>/webpack.config.js
. Follow similar steps described above. Notice that after adding acypress.config.js -> component.devServer.webpackConfig
, the contents of<project-root>/webpack.config.js
are no longer merged.Screen.Recording.2022-10-05.at.12.02.16.PM.mov
NOTE: This would be a breaking change
The text was updated successfully, but these errors were encountered: