Skip to content
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): plugin should infer 'vite' for dev/serve command #29585

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jan 10, 2025

Current Behavior

We currently have a serveTargetName that defaults to serve in the @nx/vite/plugin.
This infers a vite serve command for the serve task to vite projects.

While not incorrect, it could be abrasive for users coming from the vite ecosystem to Nx.
The command to start the Vite Dev Server is vite, so we should infer this.

create-vite also creates a package.json script with "dev": "vite" meaning users are likely running npm run dev.

This creates two points of differences for vite ecosystem users.

Expected Behavior

Deprecate serveTargetName in favour of devTargetName to more closely align with lanugage from the Vite ecosystem.

Infer the command vite instead of vite serve for the serve and dev tasks.

@Coly010 Coly010 requested review from a team as code owners January 10, 2025 16:46
@Coly010 Coly010 requested a review from JamesHenry January 10, 2025 16:46
@Coly010 Coly010 self-assigned this Jan 10, 2025
@Coly010 Coly010 requested a review from jaysoo January 10, 2025 16:46
Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:34am

Copy link

nx-cloud bot commented Jan 10, 2025

View your CI Pipeline Execution ↗ for commit 80fd4f4.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 29m 19s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 59s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=f24a8... ✅ Succeeded 20s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 18s View ↗
nx documentation --no-dte ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-15 11:08:30 UTC

@Coly010 Coly010 force-pushed the vite/fix-inferred-target branch from 13c5376 to 21a6d1d Compare January 10, 2025 17:03
@Coly010 Coly010 force-pushed the vite/fix-inferred-target branch from 21a6d1d to 80fd4f4 Compare January 15, 2025 10:32
@Coly010 Coly010 merged commit 7ef4fa7 into master Jan 15, 2025
6 checks passed
@Coly010 Coly010 deleted the vite/fix-inferred-target branch January 15, 2025 17:32
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants