fix(cli): provide default NODE_ENV for build and dev commands

This commit is contained in:
Pooya Parsa 2021-04-19 22:29:39 +02:00
parent f0443c2ba6
commit 586709a82d
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import { resolve } from 'path'
import { requireModule } from '../utils/cjs'
export async function invoke (args) {
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const rootDir = resolve(args._[0] || '.')
const { loadNuxt, buildNuxt } = requireModule('@nuxt/kit', rootDir)

View File

@ -8,6 +8,7 @@ import { error, info } from '../utils/log'
import { diff, printDiff } from '../utils/diff'
export async function invoke (args) {
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const server = createServer()
const listener = await server.listen({ clipboard: true, open: true })