-
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
feat(vite): nodes for build, serve, test, preview targets #20086
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit d0ca6fc. 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. |
d1b9860
to
b8f5f81
Compare
5f72ba9
to
e3b29d8
Compare
e3b29d8
to
a022bc7
Compare
a022bc7
to
9d78661
Compare
7deda84
to
303393d
Compare
fbe0e61
to
ccf2dfe
Compare
f76740b
to
b512512
Compare
ab77acc
to
49ee5ae
Compare
54951c6
to
e54164b
Compare
e54164b
to
0456058
Compare
f4900a1
to
09981e8
Compare
012a74c
to
474b2a5
Compare
474b2a5
to
81ca782
Compare
81ca782
to
719801a
Compare
719801a
to
d0ca6fc
Compare
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. |
A plugin (
@nx/vite/plugin
) which will add Vite targets/projects to the Nx project graph. This allows you to run Vite for projects that have avite.config.ts
file without creating aproject.json
file.To-do's
vite.config.ts
.js
cannot use import outside module
on pure.ts
vite appspassWithNoTests
should be moved totargetDefaults
likejest
reportsDirectory
shouldn't be passed in the executor options but rather in the configstatic-serve
Once this PR is merged, we can add the cypress web server config.
How it works
On
@nx/vite:init
(which is called through the@nx/vite:configuration
generator, and the@nx/react:app|lib
and@nx/web:app|lib
generators) this is added in thenx.json
:so that you can run
nx build vite
,nx test vite
etc, without manually defining these targets in your projects'project.json
.The plugin generates these targets with bare minimum (no extra) options configuration. Any options you need for your vite app, you can add in your project's
vite.config.ts
.Docs changes
Simple docs page: https://nx-dev-git-fork-mandarini-feat-vite-nodes-nrwl.vercel.app/nx-api/vite/documents/vite-nodes-plugin (to be discussed?)
FIXED ISSUES
FIXED: Why it does not like
js
Solutions
async
.readFileSync
and then AST parsing.FIXED:
cannot use import outside module
on pure.ts
vite appsIt does not like the loaded
vite.config.ts
.Solutions
loadConfigFromFile
function, whenasync
is readyreadFileSync
and then AST parsing.