Closed levipadre closed 4 years ago
I need to pass 'development' or 'production' to environment, like mix.inProduction() ? 'production' : 'development'. But don't know how that works with manageEnv.
environment
mix.inProduction() ? 'production' : 'development'
manageEnv
I have something like this (the mentioned part is wrong of course):
mix.njk(paths.src.templates, (mix.inProduction() ? paths.dist.base : paths.temp.base), { ext: '.html', data: require('./data.json'), envOptions: { lstripBlocks: true, autoescape: true, trimBlocks: true }, manageEnv: { 'environment': mix.inProduction() ? 'production' : 'development' } });
If anybody needs it, I figured it out at the end:
data: { ...(require('./data.json')), environment: mix.inProduction() ? 'production' : 'development' },
I need to pass 'development' or 'production' to
environment
, likemix.inProduction() ? 'production' : 'development'
. But don't know how that works withmanageEnv
.I have something like this (the mentioned part is wrong of course):