From fc0ef3570e270e3db24fe2ee6f4888f41fe48717 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Mon, 26 Jun 2023 11:35:53 -0600 Subject: [PATCH] docs(nextjs): Update nextjs docs since --root was removed (#17796) --- docs/generated/packages/next/executors/build.json | 2 +- packages/next/docs/build-next-executor-examples.md | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/generated/packages/next/executors/build.json b/docs/generated/packages/next/executors/build.json index 954eb76a6b..3cd26544c5 100644 --- a/docs/generated/packages/next/executors/build.json +++ b/docs/generated/packages/next/executors/build.json @@ -75,7 +75,7 @@ } }, "required": ["outputPath"], - "examplesFile": "---\ntitle: Next.js builder executor examples\ndescription: This page contains examples for the @nx/next:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"root\": \".\",\n \"outputPath\": \"dist/acme\"\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:build\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:build` executor is integrated to use Next.js' CLI. You can read more about the build options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"root\": \".\",\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\"\n },\n \"production\": {}\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable debug\" %}\n\nYou can create a debug build for more verbose output by:\n\nUsing the `--debug` flag\n\n```shell\nnx run acme:build:development --debug\n```\n\nUpdating the build options to include `debug`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"root\": \".\",\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n \"debug\": true\n },\n \"production\": {}\n }\n },\n```\n\n```bash\nnx run acme:build:development\n```\n\n{% /tab %}\n\n{% tab label=\"Adding profiling\" %}\n\nYou can enable profiing for React by\n\nUsing the `--profile` flag\n\n```shell\nnx run acme:build:production --profile\n```\n\nUpdating the build options to include `profile`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"root\": \".\",\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n },\n \"production\": {\n \"profile\": true\n }\n }\n },\n```\n\n```shell\nnx run acme:build:production\n```\n\n{% /tab %}\n\n{% tab label=\"Enable experimental app only\" %}\n\nSince Next.js 13 the `app/` directory it is reserved.\nYou can enable to build only `app/` routes by\n\nUsing the `--experimentalAppOnly` flag\n\n```shell\nnx run acme:build:production --experimentalAppOnly\n```\n\nUpdating the build options to include `experimentalAppOnly`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"root\": \".\",\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n \"experimentalAppOnly\": true\n },\n \"production\": {}\n }\n },\n```\n\n```shell\nnx run acme:build:production\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "---\ntitle: Next.js builder executor examples\ndescription: This page contains examples for the @nx/next:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"outputPath\": \"dist/acme\"\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:build\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:build` executor is integrated to use Next.js' CLI. You can read more about the build options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\"\n },\n \"production\": {}\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable debug\" %}\n\nYou can create a debug build for more verbose output by:\n\nUsing the `--debug` flag\n\n```shell\nnx run acme:build:development --debug\n```\n\nUpdating the build options to include `debug`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n \"debug\": true\n },\n \"production\": {}\n }\n },\n```\n\n```bash\nnx run acme:build:development\n```\n\n{% /tab %}\n\n{% tab label=\"Adding profiling\" %}\n\nYou can enable profiing for React by\n\nUsing the `--profile` flag\n\n```shell\nnx run acme:build:production --profile\n```\n\nUpdating the build options to include `profile`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n },\n \"production\": {\n \"profile\": true\n }\n }\n },\n```\n\n```shell\nnx run acme:build:production\n```\n\n{% /tab %}\n\n{% tab label=\"Enable experimental app only\" %}\n\nSince Next.js 13 the `app/` directory it is reserved.\nYou can enable to build only `app/` routes by\n\nUsing the `--experimentalAppOnly` flag\n\n```shell\nnx run acme:build:production --experimentalAppOnly\n```\n\nUpdating the build options to include `experimentalAppOnly`.\n\n```json\n \"build\": {\n \"executor\": \"@nx/next:build\",\n \"outputs\": [\"{options.outputPath}\"],\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"outputPath\": \"dist/acme\"\n },\n \"configurations\": {\n \"development\": {\n \"outputPath\": \".\",\n \"experimentalAppOnly\": true\n },\n \"production\": {}\n }\n },\n```\n\n```shell\nnx run acme:build:production\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Build a Next.js application.", diff --git a/packages/next/docs/build-next-executor-examples.md b/packages/next/docs/build-next-executor-examples.md index 29d48e50f6..46bf13c051 100644 --- a/packages/next/docs/build-next-executor-examples.md +++ b/packages/next/docs/build-next-executor-examples.md @@ -19,7 +19,6 @@ description: This page contains examples for the @nx/next:build executor. "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "root": ".", "outputPath": "dist/acme" } } @@ -47,7 +46,6 @@ This is the default configuration for Next.js standalone projects. Our `@nx/next "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "root": ".", "outputPath": "dist/acme" }, "configurations": { @@ -78,7 +76,6 @@ Updating the build options to include `debug`. "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "root": ".", "outputPath": "dist/acme" }, "configurations": { @@ -115,7 +112,6 @@ Updating the build options to include `profile`. "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "root": ".", "outputPath": "dist/acme" }, "configurations": { @@ -154,7 +150,6 @@ Updating the build options to include `experimentalAppOnly`. "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "root": ".", "outputPath": "dist/acme" }, "configurations": {