mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
fix(cli): provide default NODE_ENV for build and dev commands
This commit is contained in:
parent
f0443c2ba6
commit
586709a82d
@ -3,6 +3,7 @@ import { resolve } from 'path'
|
|||||||
import { requireModule } from '../utils/cjs'
|
import { requireModule } from '../utils/cjs'
|
||||||
|
|
||||||
export async function invoke (args) {
|
export async function invoke (args) {
|
||||||
|
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
|
||||||
const rootDir = resolve(args._[0] || '.')
|
const rootDir = resolve(args._[0] || '.')
|
||||||
|
|
||||||
const { loadNuxt, buildNuxt } = requireModule('@nuxt/kit', rootDir)
|
const { loadNuxt, buildNuxt } = requireModule('@nuxt/kit', rootDir)
|
||||||
|
@ -8,6 +8,7 @@ import { error, info } from '../utils/log'
|
|||||||
import { diff, printDiff } from '../utils/diff'
|
import { diff, printDiff } from '../utils/diff'
|
||||||
|
|
||||||
export async function invoke (args) {
|
export async function invoke (args) {
|
||||||
|
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
|
||||||
const server = createServer()
|
const server = createServer()
|
||||||
const listener = await server.listen({ clipboard: true, open: true })
|
const listener = await server.listen({ clipboard: true, open: true })
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user