The dev Property

  • Type: Boolean
  • Default: true

Define the development or production mode of nuxt.js

This property is overwritten by 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:



module.exports = {
  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
let config = require('./nuxt.config.js')
const nuxt = new Nuxt(config)

// Build only in dev mode
if ( {
  new Builder(nuxt).build()
  .catch((error) => {

// Listen the server
app.listen(port, '').then(() => {

Then in your package.json:

  "scripts": {
    "dev": "node server.js",
    "build": "nuxt build",
    "start": "cross-env NODE_ENV=production node server.js"

Note: You'll need to run npm install --save-dev cross-env for the above example to work. If you're not developing on Windows you can leave cross-env out of your start script and set NODE_ENV directly.

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!