-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(vite): vitest migration add reporters #20823
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit fa85165. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
6fdbf4e
to
fa85165
Compare
...options, | ||
...buildTargetOptions, |
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.
So buildTarget
options should override the serve
target options? 🤔
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.
Yes, because ideally there would not be any overriding done, since there are no common options in serve and build. In any case, it's better to configure your project in vite.config.ts
!
if this surfaces any errors we can revisit, but we're trying to keep the executor logic as minimal as possible.
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 see how this may seem confusing or wrong, however here's the thing:
When the options are loaded in the executor, the executor loads the main options from build, along with the options under the development
configuration, for example:
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/my-app",
"generatePackageJson": false
},
"configurations": {
"development": {
"mode": "development",
"watch": true
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"options": {
"buildTarget": "my-app:build"
},
"configurations": {
"development": {
"buildTarget": "my-app:build:development",
"hmr": true
},
"production": {
"buildTarget": "my-app:build:production",
"hmr": false
}
}
},
It's up to the user to make sure these are set the way the user prefers.
In this case, it would load from build the following:
{
"outputPath": "dist/apps/my-app",
"generatePackageJson": false,
"mode": "development",
"watch": true
}
And the options that would be loaded from serve would be:
{
"buildTarget": "my-app:build:development",
"hmr": true
}
All these will be simplified in the near future, when we will be moving away from executors, and the logic will be much more transparent.
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.
Oh! I see! serve
and build
targets have different schemas.
So that's why ideally there shouldn't be any overrides. It's the extra args that kinda allows the overriding. That got me confused. Although it's possible to setup mode
in the serve
target options, it shouldn't be done. Is that correct?
Thanks for the taking the time to explain! 🙇🏻♂️
Hi friends. I am facing the reporter problem in my project now. Migrating to v17.2.7 seems not working for me, so do I have to wait for a v17.3.x version since I see this PR's migration has a |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
vitest
Related Issue(s)
Fixes #20816 #20804