You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
372 B
JavaScript

function withStoreConfig(nextConfig = {}) {
const features = nextConfig.features || {}
delete nextConfig.features
nextConfig.env = nextConfig.env || {}
Object.entries(features).forEach(([key, value]) => {
if (value) {
nextConfig.env[`FEATURE_${key.toUpperCase()}_ENABLED`] = true
}
})
return nextConfig
}
module.exports = { withStoreConfig }