feat: expose process.env.SIGMA_PRESET

This commit is contained in:
Pooya Parsa 2020-11-20 15:34:47 +01:00
parent 0b51fb3bc3
commit 02a66ab40c
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,9 @@ export default function (nuxt, moduleContainer) {
sigmaDevContext._internal.hooks.hook('renderLoading',
(req, res) => nuxt.callHook('server:nuxt:renderLoading', req, res))
// Expose process.env.SIGMA_PRESET
nuxt.options.env.SIGMA_PRESET = sigmaContext.preset
// Replace nuxt server
if (nuxt.server) {
nuxt.server.__closed = true

View File

@ -92,7 +92,8 @@ export const getRollupConfig = (sigmaContext: SigmaContext) => {
'process.env.NUXT_STATIC_BASE': JSON.stringify(sigmaContext._nuxt.staticAssets.base),
'process.env.NUXT_STATIC_VERSION': JSON.stringify(sigmaContext._nuxt.staticAssets.version),
// @ts-ignore
'process.env.NUXT_FULL_STATIC': sigmaContext.fullStatic
'process.env.NUXT_FULL_STATIC': sigmaContext.fullStatic,
'process.env.SIGMA_PRESET': JSON.stringify(sigmaContext.preset)
}
}))