The dev Property

  • Type: Boolean
  • Default: true

Define the development or production mode of Nuxt.js.

This property is overwritten by the nuxt commands:

  • dev is forced to true with nuxt
  • dev is forced to false with nuxt build, nuxt start and nuxt generate

This property should be used when using Nuxt.js programmatically:

export default {
  dev: process.env.NODE_ENV !== 'production'
const { Nuxt, Builder } = require('nuxt')
const app = require('express')()
const port = process.env.PORT || 3000

// We instantiate Nuxt.js with the options
const config = require('./nuxt.config.js')
const nuxt = new Nuxt(config)

// Build only in dev mode
if ( {
  new Builder(nuxt).build()

// Listen the server
app.listen(port, '').then(() => {
  console.log(`Server is listening on port: ${port}`)
  "scripts": {
    "dev": "node server.js",
    "build": "nuxt build",
    "start": "NODE_ENV=production node server.js"

如何提交问题或文档贡献? 在 GitHub 编辑此页面!

Platinum Sponsors

StoryblokMoovwebShip Shape Support Us