The rootDir Property

  • Type: String
  • Default: process.cwd()

Define the workspace of your nuxt.js application.

This property is overwritten by nuxt commands and set to the argument of the command (example: nuxt my-app/ will set the rootDir to my-app/ with its absolute path).

This property should be used when using nuxt.js programmatically.

The downside of this option is that your node_modules directory should be inside the rootDir folder. If you want to set the path of the application without the node_modules, use the srcDir option.

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