Skip to content

feat(nextjs): add experimental-build-mode option to support compile only#26465

Merged
ndcunningham merged 4 commits intonrwl:masterfrom
dfr-exnaton:feat/next-add-build-mode
Jun 26, 2024
Merged

feat(nextjs): add experimental-build-mode option to support compile only#26465
ndcunningham merged 4 commits intonrwl:masterfrom
dfr-exnaton:feat/next-add-build-mode

Conversation

@dfr-exnaton
Copy link
Copy Markdown
Contributor

Current Behavior

The nextjs build executor does not support all build flags such as --experimental-build-mode (see https://nextjs.org/docs/app/api-reference/next-cli#build).

Expected Behavior

For certain deployment models (e.g. mult-environment builds), it is helpful to only compile but not generate pages at build time. See vercel/next.js#46544 for a discussion.

@dfr-exnaton dfr-exnaton requested review from a team as code owners June 7, 2024 21:11
@dfr-exnaton dfr-exnaton requested a review from ndcunningham June 7, 2024 21:11
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 7, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jun 10, 2024 7:22am

@cyrus-za
Copy link
Copy Markdown

cyrus-za commented Jun 8, 2024

Thanks for opening this PR. This has been high on my wishlist for quite some time

dfr-exnaton and others added 3 commits June 10, 2024 09:16
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
- wrapper echo's its contents
- wrapper doesn't exit properly
- wrapper has LF line endings

## Expected Behavior
- wrapper is silent
- wrapper exits early
- wrapper has CRLF endings

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes nrwl#26254
@dfr-exnaton dfr-exnaton force-pushed the feat/next-add-build-mode branch from 6eeca05 to 484d1a5 Compare June 10, 2024 07:18
@dfr-exnaton dfr-exnaton requested a review from a team as a code owner June 10, 2024 07:18
@dfr-exnaton dfr-exnaton requested a review from xiongemi June 10, 2024 07:18
"experimentalBuildMode": {
"type": "string",
"description": "Change the build mode.",
"enum": ["compile", "generate"]
Copy link
Copy Markdown
Contributor Author

@dfr-exnaton dfr-exnaton Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some confusion w.r.t. to the default option. The documentation shows it as available, if you pass it the CLI will complain though.

@dfr-exnaton
Copy link
Copy Markdown
Contributor Author

@ndcunningham could you have a quick look? This is a super small and non-intrusive change making lives for users of nextjs in a 12-factor setting much easier... thanks a lot!

Copy link
Copy Markdown
Contributor

@ndcunningham ndcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@ndcunningham ndcunningham merged commit 0ca7df7 into nrwl:master Jun 26, 2024
meeroslav pushed a commit that referenced this pull request Jun 27, 2024
…nly (#26465)

## Current Behavior

The nextjs build executor does not support all build flags such as
`--experimental-build-mode` (see
https://nextjs.org/docs/app/api-reference/next-cli#build).

## Expected Behavior

For certain deployment models (e.g. mult-environment builds), it is
helpful to only compile but not generate pages at build time. See
vercel/next.js#46544 for a discussion.

---------

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 2, 2024

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 Jul 2, 2024
@dfr-exnaton dfr-exnaton deleted the feat/next-add-build-mode branch July 2, 2024 05:37
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.

5 participants