-
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(nextjs): allow withNx to be used with other executors such as run-commands #17819
feat(nextjs): allow withNx to be used with other executors such as run-commands #17819
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit b955e21. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@@ -421,7 +435,7 @@ describe('Next.js Applications', () => { | |||
checkUnitTest: false, | |||
checkLint: false, | |||
checkE2E: false, | |||
checkExport: true, | |||
checkExport: false, |
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.
We really don't care about exports at this point since it's a deprecated Next.js command.
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.
LGTM
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. |
This PR allows
withNx
plugin to be used without@nx/next:build
or@nx/next:server
executors. As long as the command runs through Nx we can read the run information (e.g. project node, options, config) from the project graph.Why?
There are legit cases where users may not use
@nx/next:build
or other expected executors.@nx/next:build
into their own custom plugin, say@acme/next:build
.run-commands
to executenpx next build
directly.After some thought, they only special case is that
buildTarget
ordevServerTarget
may be present, which requires additional reading of those target configurations. These special cases could be@nx/next:server
that specifybuildTarget
, which defines theoutputPath
for example. Or when Cypress defines adevServerTarget
, which then defines abuildTarget
, so we need to follow that target chain fully.In all other cases, we can safely fallback to the default behavior, which is to return the configuration for the current target. This could be either
@nx/next:build
,run-commands
, or a custom executor.Current Behavior
Using
run-commands
orcommand
breaks withwithNx
.Expected Behavior
Using
run-commands
orcommand
does not break withwithNx
.Related Issue(s)
Fixes #16064, #16277