Skip to content

Commit

Permalink
feat(nextjs): deprecate proxy config option for server executor (#15855)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Mar 23, 2023
1 parent 7d61ae2 commit e611a0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/generated/packages/next/executors/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"proxyConfig": {
"type": "string",
"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": {
"type": "boolean",
Expand Down
3 changes: 2 additions & 1 deletion packages/next/src/executors/server/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"proxyConfig": {
"type": "string",
"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": {
"type": "boolean",
Expand Down
7 changes: 3 additions & 4 deletions packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import {
import { customServer } from './lib/custom-server';
import { defaultServer } from './lib/default-server';

const infoPrefix = `[ ${chalk.dim(chalk.cyan('info'))} ] `;

export default async function* serveExecutor(
options: NextServeBuilderOptions,
context: ExecutorContext
Expand Down Expand Up @@ -79,9 +77,10 @@ async function* runNextDevServer(
? join(context.root, options.proxyConfig)
: join(root, 'proxy.conf.json');

// TODO(v16): Remove proxy support.
if (existsSync(proxyConfigPath)) {
logger.info(
`${infoPrefix} found proxy configuration at ${proxyConfigPath}`
logger.warn(
`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);
}
Expand Down

1 comment on commit e611a0b

@vercel
Copy link

@vercel vercel bot commented on e611a0b Mar 23, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.