Difference between revisions of "Nuxt.JS Configuration"

From WikiOD
(Created page with "The default configuration of Nuxt.js covers most of the use cases, and the default configuration can be overridden by nuxt.config.js. =====build===== Nuxt.js allows you to ad...")
 
 
Line 4: Line 4:
 
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.
 
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.
  
[https://www.nuxtjs.cn/api/configuration-build Detailed documentation on build configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build Detailed documentation on build configuration items]
  
 
=====css=====
 
=====css=====
 
This configuration item is used to define the application's global style files, modules or third-party libraries (which all pages need to reference).
 
This configuration item is used to define the application's global style files, modules or third-party libraries (which all pages need to reference).
  
[https://www.nuxtjs.cn/api/configuration-css Detailed documentation on css configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-css Detailed documentation on CSS configuration items]
  
 
=====dev=====
 
=====dev=====
 
This configuration item is used to configure whether the Nuxt.js application is in development or production mode.
 
This configuration item is used to configure whether the Nuxt.js application is in development or production mode.
  
[https://www.nuxtjs.cn/api/configuration-dev Detailed documentation on dev configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-dev Detailed documentation on dev configuration items]
  
 
=====env=====
 
=====env=====
 
This configuration item is used to define the environment variables of the application client and server.
 
This configuration item is used to define the environment variables of the application client and server.
  
[https://www.nuxtjs.cn/api/configuration-env Detailed documentation on env configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-env Detailed documentation on env configuration items]
  
 
=====generate=====
 
=====generate=====
 
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.
 
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.
  
[https://www.nuxtjs.cn/api/configuration-generate Detailed documentation on generate configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate Detailed documentation on generate configuration items]
  
 
=====head=====
 
=====head=====
 
This configuration item is used to configure the default meta tag of the application.
 
This configuration item is used to configure the default meta tag of the application.
  
[https://www.nuxtjs.cn/api/configuration-head Detailed documentation on the head configuration item]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-head Detailed documentation on the head configuration item]
  
 
=====loading=====
 
=====loading=====
 
This configuration item is used to personalize the loading components used by Nuxt.js.
 
This configuration item is used to personalize the loading components used by Nuxt.js.
  
[https://www.nuxtjs.cn/api/configuration-loading Detailed documentation on loading configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-loading Detailed documentation on loading configuration items]
  
 
=====modules=====
 
=====modules=====
 
This configuration item allows you to add Nuxt modules to the project.
 
This configuration item allows you to add Nuxt modules to the project.
  
[https://www.nuxtjs.cn/api/configuration-modules Detailed documentation on modules configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-modules Detailed documentation on modules configuration items]
  
 
=====modulesDir=====
 
=====modulesDir=====
 
This configuration item allows you to define the node_modules folder of the Nuxt.js application.
 
This configuration item allows you to define the node_modules folder of the Nuxt.js application.
  
[https://www.nuxtjs.cn/api/configuration-modulesdir Detailed documentation on modulesDir configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-modulesdir Detailed documentation on modulesDir configuration items]
  
 
=====plugins=====
 
=====plugins=====
 
This configuration item is used to configure those Javascript plug-ins that need to be run before the root vue.js application is instantiated.
 
This configuration item is used to configure those Javascript plug-ins that need to be run before the root vue.js application is instantiated.
  
[https://www.nuxtjs.cn/api/configuration-plugins Detailed documentation on plugins configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-plugins Detailed documentation on plugins configuration items]
  
 
=====rootDir=====
 
=====rootDir=====
 
This configuration item is used to configure the root directory of the Nuxt.js application.
 
This configuration item is used to configure the root directory of the Nuxt.js application.
  
[https://www.nuxtjs.cn/api/configuration-rootdir Detailed documentation on rootDir configuration item]s
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-rootdir Detailed documentation on rootDir configuration item]s
  
 
=====router=====
 
=====router=====
 
This configuration item can be used to override the default vue-router configuration of Nuxt.js.
 
This configuration item can be used to override the default vue-router configuration of Nuxt.js.
  
[https://www.nuxtjs.cn/api/configuration-router Detailed documentation on router configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-router Detailed documentation on router configuration items]
  
 
=====server=====
 
=====server=====
 
This option allows you to configure the server instance variables of the Nuxt.js application.
 
This option allows you to configure the server instance variables of the Nuxt.js application.
  
[https://www.nuxtjs.cn/api/configuration-server Detailed documentation on server configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-server Detailed documentation on server configuration items]
  
 
=====srcDir=====
 
=====srcDir=====
 
This configuration item is used to configure the source directory path of the application.
 
This configuration item is used to configure the source directory path of the application.
  
[https://www.nuxtjs.cn/api/configuration-srcdir Detailed documentation on srcDir configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-srcdir Detailed documentation on srcDir configuration items]
  
=====to you=====
+
=====dir=====
 
This option allows you to configure a custom directory for the Nuxt.js application.
 
This option allows you to configure a custom directory for the Nuxt.js application.
  
[https://www.nuxtjs.cn/api/configuration-dir Documentation about dir integration]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-dir Documentation about dir integration]
  
 
=====transition=====
 
=====transition=====
 
This configuration item is used to personally configure the default value of the transition effect attribute of the application.
 
This configuration item is used to personally configure the default value of the transition effect attribute of the application.
  
[https://www.nuxtjs.cn/api/configuration-transition Detailed documentation on transition configuration items]
+
[https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-transition Detailed documentation on transition configuration items]
  
 
[[category:Nuxt.js Tutorials|4]]
 
[[category:Nuxt.js Tutorials|4]]

Latest revision as of 10:04, 24 August 2021

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