next.config.js: use rewrites only for development

This commit is contained in:
Chika 2022-07-17 10:27:13 +03:00
parent ab0670ddf8
commit eea7109fe6

View File

@ -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 = [