another config
All checks were successful
/ registry_publish (push) Successful in 1m42s

This commit is contained in:
zramsay 2025-02-05 17:29:48 -05:00
parent 82307585bd
commit 8a7c4b7ccf

View File

@ -1,23 +1,22 @@
// 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
}, {})
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
swcMinify: true,
webpack: (config) => {
config.plugins.push(new webpack.DefinePlugin(envMap))
// Let the build script handle the DefinePlugin injection
// The script will add the envMap DefinePlugin automatically
return config
}
}
module.exports = withBundleAnalyzer(nextConfig)
if (process.env.NODE_ENV === 'production') {
// Let the build script transform this
const __orig_cfg__ = withBundleAnalyzer(nextConfig)
} else {
// For development, export directly
module.exports = withBundleAnalyzer(nextConfig)
}