From eea7109fe60884917345b82434c614000f16af24 Mon Sep 17 00:00:00 2001 From: Chika Date: Sun, 17 Jul 2022 10:27:13 +0300 Subject: [PATCH] next.config.js: use rewrites only for development --- next.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/next.config.js b/next.config.js index 2550335..5e63f28 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,4 @@ +/* eslint-disable operator-linebreak */ /* eslint-disable @typescript-eslint/no-var-requires */ const withPlugins = require('next-compose-plugins'); const withLess = require('next-with-less'); @@ -23,6 +24,16 @@ const nextConfig = { }, }, }, + rewrites: + process.env.NODE_ENV === 'development' && + async function rewrites() { + return [ + { + source: process.env.NEXT_PUBLIC_URL_CRM_GRAPHQL_PROXY, + destination: process.env.NEXT_PUBLIC_URL_CRM_GRAPHQL_DIRECT, + }, + ]; + }, }; const plugins = [