mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 12:11:22 +00:00
33 lines
991 B
TypeScript
33 lines
991 B
TypeScript
import forceIsomorphicConfigValues from './utils/forceIsomorphicConfigValues'
|
|
import requireConfig from './utils/requireConfig'
|
|
|
|
const isomorphicConfig = {
|
|
spreeApiHost: process.env.NEXT_PUBLIC_SPREE_API_HOST,
|
|
defaultLocale: process.env.NEXT_PUBLIC_SPREE_DEFAULT_LOCALE,
|
|
cartCookieName: process.env.NEXT_PUBLIC_SPREE_CART_COOKIE_NAME,
|
|
spreeImageHost: process.env.NEXT_PUBLIC_SPREE_IMAGE_HOST,
|
|
spreeCategoriesTaxonomyId:
|
|
process.env.NEXT_PUBLIC_SPREE_CATEGORIES_TAXONOMY_ID,
|
|
spreeBrandsTaxonomyId: process.env.NEXT_PUBLIC_SPREE_BRANDS_TAXONOMY_ID,
|
|
}
|
|
|
|
export default forceIsomorphicConfigValues(
|
|
isomorphicConfig,
|
|
[],
|
|
[
|
|
'spreeApiHost',
|
|
'defaultLocale',
|
|
'cartCookieName',
|
|
'spreeImageHost',
|
|
'spreeCategoriesTaxonomyId',
|
|
'spreeBrandsTaxonomyId',
|
|
]
|
|
)
|
|
|
|
type IsomorphicConfig = typeof isomorphicConfig
|
|
|
|
const requireConfigValue = (key: keyof IsomorphicConfig) =>
|
|
requireConfig<IsomorphicConfig>(isomorphicConfig, key)
|
|
|
|
export { requireConfigValue }
|