From 54dc022980c8850221d726692334963844a7d446 Mon Sep 17 00:00:00 2001 From: Ihor Date: Thu, 19 Dec 2024 13:32:56 +0100 Subject: [PATCH] chore(gene-tools): update next.config.js generation (#42) --- .../bff-app-generator/files/app/next.config.js__tmpl__ | 6 ++++-- .../nextjs-app-generator/files/app/next.config.js__tmpl__ | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/gene-tools/src/generators/bff-app-generator/files/app/next.config.js__tmpl__ b/packages/gene-tools/src/generators/bff-app-generator/files/app/next.config.js__tmpl__ index 4b3ec06..b82c30c 100644 --- a/packages/gene-tools/src/generators/bff-app-generator/files/app/next.config.js__tmpl__ +++ b/packages/gene-tools/src/generators/bff-app-generator/files/app/next.config.js__tmpl__ @@ -31,8 +31,8 @@ const devPlugins = []; const plugins = [ withNodeModulesCSS, withBundleAnalyzer, - withNx, withBuildId, + withNx, ].concat( process.env.NEXT_PUBLIC_ENV === 'local' ? devPlugins : productionPlugins ); @@ -44,7 +44,7 @@ const domains = [ 'srv-supersonic-images.z-dn.net', ]; -module.exports = () => { +const getConfig = () => { return plugins.reduce( (acc, next) => { if (typeof next !== 'function') { @@ -96,3 +96,5 @@ module.exports = () => { } ); }; + +module.exports = getConfig(); diff --git a/packages/gene-tools/src/generators/nextjs-app-generator/files/app/next.config.js__tmpl__ b/packages/gene-tools/src/generators/nextjs-app-generator/files/app/next.config.js__tmpl__ index 18c4934..a8a7f0b 100644 --- a/packages/gene-tools/src/generators/nextjs-app-generator/files/app/next.config.js__tmpl__ +++ b/packages/gene-tools/src/generators/nextjs-app-generator/files/app/next.config.js__tmpl__ @@ -22,7 +22,7 @@ const plugins = [withNodeModulesCSS, withBundleAnalyzer, withNx].concat( const domains = [ ]; -module.exports = () => { +const getConfig = () => { return plugins.reduce( (acc, next) => { if (typeof next !== 'function') { @@ -74,3 +74,5 @@ module.exports = () => { } ); }; + +module.exports = getConfig();