EvoCalculator.Client2/next.config.js
2022-07-17 13:32:42 +03:00

56 lines
1.2 KiB
JavaScript

/* eslint-disable operator-linebreak */
/* eslint-disable @typescript-eslint/no-var-requires */
const withPlugins = require('next-compose-plugins');
const withLess = require('next-with-less');
const withGraphQL = require('next-plugin-graphql');
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
swcMinify: true,
reactStrictMode: true,
eslint: {
ignoreDuringBuilds: true,
},
compiler: {
styledComponents: true,
},
pageExtensions: ['tsx', 'jsx'],
experimental: {
modularizeImports: {
'lodash-es': {
transform: 'lodash-es/{{member}}',
preventFullImport: true,
},
},
},
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 = [
[
withLess,
{
lessLoaderOptions: {
lessOptions: {
modifyVars: {
'primary-color': process.env.NEXT_PUBLIC_COLOR_PRIMARY,
},
},
},
},
],
[withGraphQL],
];
module.exports = withPlugins(plugins, nextConfig);