feat(nextjs): deprecate proxy config option for server executor (#15855)
This commit is contained in:
parent
7d61ae238b
commit
e611a0bab7
@ -51,7 +51,8 @@
|
|||||||
"proxyConfig": {
|
"proxyConfig": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Path to the proxy configuration file.",
|
"description": "Path to the proxy configuration file.",
|
||||||
"x-completion-type": "file"
|
"x-completion-type": "file",
|
||||||
|
"x-deprecated": "Use the built-in rewrite feature from Next.js. See: https://nextjs.org/docs/api-reference/next.config.js/rewrites"
|
||||||
},
|
},
|
||||||
"buildLibsFromSource": {
|
"buildLibsFromSource": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|||||||
@ -48,7 +48,8 @@
|
|||||||
"proxyConfig": {
|
"proxyConfig": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Path to the proxy configuration file.",
|
"description": "Path to the proxy configuration file.",
|
||||||
"x-completion-type": "file"
|
"x-completion-type": "file",
|
||||||
|
"x-deprecated": "Use the built-in rewrite feature from Next.js. See: https://nextjs.org/docs/api-reference/next.config.js/rewrites"
|
||||||
},
|
},
|
||||||
"buildLibsFromSource": {
|
"buildLibsFromSource": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|||||||
@ -20,8 +20,6 @@ import {
|
|||||||
import { customServer } from './lib/custom-server';
|
import { customServer } from './lib/custom-server';
|
||||||
import { defaultServer } from './lib/default-server';
|
import { defaultServer } from './lib/default-server';
|
||||||
|
|
||||||
const infoPrefix = `[ ${chalk.dim(chalk.cyan('info'))} ] `;
|
|
||||||
|
|
||||||
export default async function* serveExecutor(
|
export default async function* serveExecutor(
|
||||||
options: NextServeBuilderOptions,
|
options: NextServeBuilderOptions,
|
||||||
context: ExecutorContext
|
context: ExecutorContext
|
||||||
@ -79,9 +77,10 @@ async function* runNextDevServer(
|
|||||||
? join(context.root, options.proxyConfig)
|
? join(context.root, options.proxyConfig)
|
||||||
: join(root, 'proxy.conf.json');
|
: join(root, 'proxy.conf.json');
|
||||||
|
|
||||||
|
// TODO(v16): Remove proxy support.
|
||||||
if (existsSync(proxyConfigPath)) {
|
if (existsSync(proxyConfigPath)) {
|
||||||
logger.info(
|
logger.warn(
|
||||||
`${infoPrefix} found proxy configuration at ${proxyConfigPath}`
|
`The "proxyConfig" option will be removed in Nx 16. Use the "rewrites" feature from Next.js instead. See: https://nextjs.org/docs/api-reference/next.config.js/rewrites`
|
||||||
);
|
);
|
||||||
proxyConfig = require(proxyConfigPath);
|
proxyConfig = require(proxyConfigPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user