Nuxt.JS Configuration

From WikiOD

The default configuration of Nuxt.js covers most of the use cases, and the default configuration can be overridden by nuxt.config.js.

build[edit | edit source]

Nuxt.js allows you to add some modules to the automatically generated vendor.bundle.js file to reduce the size of the application bundle. If your application relies on third-party modules, this configuration item is very useful.

Detailed documentation on build configuration items

css[edit | edit source]

This configuration item is used to define the application's global style files, modules or third-party libraries (which all pages need to reference).

Detailed documentation on CSS configuration items

dev[edit | edit source]

This configuration item is used to configure whether the Nuxt.js application is in development or production mode.

Detailed documentation on dev configuration items

env[edit | edit source]

This configuration item is used to define the environment variables of the application client and server.

Detailed documentation on env configuration items

generate[edit | edit source]

This configuration item is used to define the parameters of each dynamic routing. Nuxt.js generates static files corresponding to the directory structure based on these routing configurations.

Detailed documentation on generate configuration items

head[edit | edit source]

This configuration item is used to configure the default meta tag of the application.

Detailed documentation on the head configuration item

loading[edit | edit source]

This configuration item is used to personalize the loading components used by Nuxt.js.

Detailed documentation on loading configuration items

modules[edit | edit source]

This configuration item allows you to add Nuxt modules to the project.

Detailed documentation on modules configuration items

modulesDir[edit | edit source]

This configuration item allows you to define the node_modules folder of the Nuxt.js application.

Detailed documentation on modulesDir configuration items

plugins[edit | edit source]

This configuration item is used to configure those Javascript plug-ins that need to be run before the root vue.js application is instantiated.

Detailed documentation on plugins configuration items

rootDir[edit | edit source]

This configuration item is used to configure the root directory of the Nuxt.js application.

Detailed documentation on rootDir configuration items

router[edit | edit source]

This configuration item can be used to override the default vue-router configuration of Nuxt.js.

Detailed documentation on router configuration items

server[edit | edit source]

This option allows you to configure the server instance variables of the Nuxt.js application.

Detailed documentation on server configuration items

srcDir[edit | edit source]

This configuration item is used to configure the source directory path of the application.

Detailed documentation on srcDir configuration items

dir[edit | edit source]

This option allows you to configure a custom directory for the Nuxt.js application.

Documentation about dir integration

transition[edit | edit source]

This configuration item is used to personally configure the default value of the transition effect attribute of the application.

Detailed documentation on transition configuration items