-
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
fix(webpack-batteries-included-preprocessor): Disable loading babel config files #16980
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
So this is blocking an unintended way that users were accidentally modifying the babel config, correct? Do users not want their babel config to apply to the webpack preprocessor? From what I can see, the cause of #8364 is that I'm probably not totally understanding this, since I've not worked in |
The intention of this package is to provide the webpack configuration (the included batteries) and not need the user to configure it. While it's possible to customize the configuration when using this package directly, that isn't be needed in most circumstances and isn't particularly advocated. If a user needs custom configuration, we recommend they use the base webpack-preprocessor. This package is what Cypress uses as the default preprocessor, and based on the reproductions in the issue, that's how users are running into this issue. They aren't using this package directly or trying to configure it. It's an unintentional side effect of babel loading these config files. The solution that seems to be accepted by a lot of users is to put an empty While we could fix the issue with module resolution, I still think we would want to turn off loading babel config files in this package by default. Especially in its use as the default preprocessor, it could cause problems to load babel plugins on top of the ones we already have configured. Also, it's likely not the intention or expectation of the user to have their source code babel config loaded for their Cypress tests. |
Alright, that makes sense, thank you for clarifying |
.babelrc
defines plugins #8364User facing changelog
.babelrc
orbabel.config.json
present in the projectAdditional details
This disables loading
.babelrc
andbabel.config.json
in the default preprocessor. Since the default preprocessor can't anticipate per-user config, it's best for it to use its own config alone. Users that need custom configuration can utilize the preprocessor plugin API.How has the user experience changed?
Preprocessing no longer fails when a project has a
.babelrc
orbabel.config.json
present. Users no longer need to add an empty.babelrc
to thecypress
directory as a workaround.PR Tasks
.babelrc
andbabel.config.json
files to the project, most of the tests will fail without the fix.cypress-documentation
?type definitions
?cypress.schema.json
?