From 82307585bdece8a5d7cf4c082ead615145c8f7f5 Mon Sep 17 00:00:00 2001 From: zramsay Date: Wed, 5 Feb 2025 17:24:23 -0500 Subject: [PATCH] also try this config --- next.config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/next.config.js b/next.config.js index fcaec90..8c02155 100644 --- a/next.config.js +++ b/next.config.js @@ -1,16 +1,23 @@ // next.config.js +const webpack = require('webpack') const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true' }) +const envMap = Object.keys(process.env) + .filter(key => key.startsWith('CERC_')) + .reduce((acc, key) => { + acc[`process.env.${key}`] = JSON.stringify(process.env[key]) + return acc + }, {}) + const nextConfig = { reactStrictMode: false, swcMinify: true, webpack: (config) => { - // Let the build script inject the DefinePlugin + config.plugins.push(new webpack.DefinePlugin(envMap)) return config } } -// Export directly - let the build script handle the transformation module.exports = withBundleAnalyzer(nextConfig)