-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: remove webpack entrypoints from for ct webpack projects #23299
Conversation
Thanks for taking the time to open a PR!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question/comment. This must go in the next release!
@@ -17,8 +17,6 @@ export function vueCliHandler (devServerConfig: WebpackDevServerConfig): PresetH | |||
|
|||
debug('webpack config %o', webpackConfig) | |||
|
|||
delete webpackConfig.entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of deleting it in many places, and then having to remember this if we implement a new webpack handler, any chance we could lift this up higher and do something like
if (!angular) {
delete webpackConfig.entry
}
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is doing exactly that. In #22314 I moved entry handling to each handler. This PR reverts those changes so that the handlers don't have to worry about entrypoints since they will be replaced with the Cypress entry here
The line you referenced is a removal, not an addition (unless I'm misunderstanding your comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with the example project and these changes resolve the webpack entrypoint issue 👍🏻
User facing changelog
Webpack entrypoints are no longer preserved for CT Webpack projects
Additional details
Fixes a regression from #22314 where webpack entrypoints were being preserved. This is mostly a revert of the changes made to entrypoints in that PR. It made sense for frameworks as their was logic added for removing entrypoints that would cause problems in each handler, but users who pass in a custom webpack config (don't use a higher-order framework like Next or create-react-app) were facing issues with their entrypoint being included and executed.
Steps to test
Checkout the repo provided in the original issue: https://gitlab.com/souf/react-webpack-playground/-/tree/cypress-webpack-entry
Install Cypress and walk through CT setup.
Create a simple spec:
Then run the spec. Nothing will load, and the console will display:
Checkout my branch and run
yarn workspace @cypress/webpack-dev-server build && yarn cypress:open
. Open the same project and no more error!How has the user experience changed?
Screen.Recording.2022-08-11.at.5.15.33.PM.mov
PR Tasks
cypress-documentation
?type definitions
?