fix(bridge): add missing process flags for vite (#2736)

This commit is contained in:
Daniel Roe 2022-01-17 10:44:56 +00:00 committed by GitHub
parent 176716bdaf
commit e27a0173e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,10 @@ async function bundle (nuxt: Nuxt, builder: any) {
mode: nuxt.options.dev ? 'development' : 'production',
logLevel: 'warn',
define: {
'process.static': nuxt.options.target === 'static',
'process.env.NODE_ENV': JSON.stringify(nuxt.options.dev ? 'development' : 'production'),
'process.mode': JSON.stringify(nuxt.options.dev ? 'development' : 'production'),
'process.target': JSON.stringify(nuxt.options.target),
'process.dev': nuxt.options.dev
},
resolve: {