|
4 | 4 | "sourceRoot": "nx-dev/nx-dev", |
5 | 5 | "projectType": "application", |
6 | 6 | "targets": { |
| 7 | + "next:build": { |
| 8 | + "dependsOn": ["copy-docs", "prebuild-banner"], |
| 9 | + "inputs": [ |
| 10 | + "production", |
| 11 | + "^production", |
| 12 | + "{projectRoot}/lib/banner.json", |
| 13 | + { "env": "NEXT_PUBLIC_ASTRO_URL" } |
| 14 | + ] |
| 15 | + }, |
7 | 16 | "build": { |
8 | | - "dependsOn": [ |
9 | | - { |
10 | | - "target": "build-base" |
11 | | - } |
12 | | - ], |
| 17 | + "dependsOn": ["copy-docs", "prebuild-banner"], |
13 | 18 | "executor": "nx:run-commands", |
14 | 19 | "options": { |
15 | | - "commands": ["nx run nx-dev:sitemap"], |
| 20 | + "commands": [ |
| 21 | + { "command": "next build", "description": "Build Next.js app" }, |
| 22 | + { |
| 23 | + "command": "pnpm next-sitemap --config ./next-sitemap.config.js && node ./scripts/patch-sitemap-index.mjs", |
| 24 | + "description": "Generate sitemap" |
| 25 | + } |
| 26 | + ], |
| 27 | + "cwd": "nx-dev/nx-dev", |
16 | 28 | "parallel": false |
17 | 29 | }, |
18 | 30 | "inputs": [ |
19 | 31 | "production", |
20 | 32 | "^production", |
21 | | - { "env": "NEXT_PUBLIC_ASTRO_URL" } |
| 33 | + "{projectRoot}/lib/banner.json", |
| 34 | + "{projectRoot}/next-sitemap.config.js", |
| 35 | + { "env": "NEXT_PUBLIC_ASTRO_URL" }, |
| 36 | + { "env": "NX_DEV_URL" }, |
| 37 | + { "env": "NEXT_PUBLIC_NO_INDEX" } |
22 | 38 | ], |
23 | | - "outputs": ["{workspaceRoot}/dist/nx-dev/nx-dev"], |
24 | | - "configurations": { |
25 | | - "netlify": { |
26 | | - "outputs": ["{workspaceRoot}/nx-dev/nx-dev/.next"] |
27 | | - } |
28 | | - } |
| 39 | + "outputs": [ |
| 40 | + "{workspaceRoot}/nx-dev/nx-dev/.next", |
| 41 | + "{workspaceRoot}/nx-dev/nx-dev/public/sitemap*.xml", |
| 42 | + "{workspaceRoot}/nx-dev/nx-dev/public/robots.txt" |
| 43 | + ] |
29 | 44 | }, |
30 | 45 | "check-links": { |
31 | 46 | "cache": true, |
|
45 | 60 | "dependsOn": ["check-links"] |
46 | 61 | }, |
47 | 62 | "sitemap": { |
48 | | - "dependsOn": ["build-base"], |
49 | 63 | "executor": "nx:run-commands", |
50 | 64 | "inputs": [ |
51 | 65 | "{workspaceRoot}/docs/**/*", |
|
54 | 68 | { "env": "NX_DEV_URL" }, |
55 | 69 | { "env": "NEXT_PUBLIC_NO_INDEX" } |
56 | 70 | ], |
57 | | - "outputs": ["{workspaceRoot}/dist/nx-dev/nx-dev/public"], |
| 71 | + "outputs": ["{workspaceRoot}/nx-dev/nx-dev/public"], |
58 | 72 | "options": { |
59 | 73 | "command": "pnpm next-sitemap --config ./nx-dev/nx-dev/next-sitemap.config.js && node ./nx-dev/nx-dev/scripts/patch-sitemap-index.mjs" |
60 | 74 | } |
|
71 | 85 | } |
72 | 86 | } |
73 | 87 | }, |
74 | | - "build-base": { |
75 | | - "parallelism": false, |
76 | | - "executor": "@nx/next:build", |
77 | | - "dependsOn": ["copy-docs", "prebuild-banner"], |
78 | | - "inputs": ["production", "^production", "{projectRoot}/lib/banner.json"], |
79 | | - "outputs": ["{options.outputPath}"], |
80 | | - "options": { |
81 | | - "root": "nx-dev/nx-dev", |
82 | | - "outputPath": "dist/nx-dev/nx-dev" |
83 | | - }, |
84 | | - "configurations": { |
85 | | - "development": { |
86 | | - "outputPath": "nx-dev/nx-dev" |
87 | | - }, |
88 | | - "production": {}, |
89 | | - "netlify": { |
90 | | - "outputPath": "nx-dev/nx-dev" |
91 | | - } |
92 | | - } |
93 | | - }, |
94 | 88 | "copy-docs": { |
95 | 89 | "inputs": ["{workspaceRoot}/docs/**/*"], |
96 | 90 | "outputs": ["{projectRoot}/public/documentation"], |
|
99 | 93 | "cwd": "nx-dev/nx-dev" |
100 | 94 | } |
101 | 95 | }, |
| 96 | + "serve": { |
| 97 | + "dependsOn": ["copy-docs", "prebuild-banner"], |
| 98 | + "command": "next dev", |
| 99 | + "options": { |
| 100 | + "cwd": "nx-dev/nx-dev" |
| 101 | + } |
| 102 | + }, |
102 | 103 | "serve-docs": { |
103 | 104 | "executor": "nx:run-commands", |
104 | 105 | "options": { |
|
110 | 111 | } |
111 | 112 | }, |
112 | 113 | "start": { |
113 | | - "dependsOn": ["build-base"], |
114 | | - "command": "nx run nx-dev:serve:production" |
115 | | - }, |
116 | | - "serve": { |
117 | | - "executor": "@nx/next:server", |
118 | | - "dependsOn": ["copy-docs", "prebuild-banner"], |
| 114 | + "dependsOn": ["build"], |
| 115 | + "command": "next start", |
119 | 116 | "options": { |
120 | | - "buildTarget": "nx-dev:build-base", |
121 | | - "dev": true |
122 | | - }, |
123 | | - "configurations": { |
124 | | - "production": { |
125 | | - "buildTarget": "nx-dev:build-base:production", |
126 | | - "dev": false |
127 | | - }, |
128 | | - "development": { |
129 | | - "buildTarget": "nx-dev:build-base:development", |
130 | | - "dev": true |
131 | | - } |
132 | | - }, |
133 | | - "defaultConfiguration": "development" |
| 117 | + "cwd": "nx-dev/nx-dev" |
| 118 | + } |
134 | 119 | }, |
135 | 120 | "deploy-build": { |
136 | 121 | "executor": "nx:run-commands", |
|
152 | 137 | "netlify": { |
153 | 138 | "commands": [ |
154 | 139 | { |
155 | | - "command": "nx run nx-dev:build-base:netlify && cp nx-dev/nx-dev/_redirects nx-dev/nx-dev/.next/_redirects && nx run nx-dev:sitemap", |
| 140 | + "command": "nx run nx-dev:build && cp nx-dev/nx-dev/_redirects nx-dev/nx-dev/.next/_redirects", |
156 | 141 | "description": "NextJs build for Netlify" |
157 | 142 | } |
158 | 143 | ] |
|
0 commit comments