medusa-nextjs-storefront/store-config.js

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 }