The modules Property (En)

  • Type: Array

Modules are Nuxt.js extensions which can extend it's core functionality and add endless integrations. Learn More

⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou participer à la traduction de celle-ci dès maintenant !

Example (`nuxt.config.js`):

module.exports = {
  modules: [
    // Using package name
    '@nuxtjs/axios',

    // Relative to your project srcDir
    '~/modules/awesome.js',

    // Providing options
    ['@nuxtjs/google-analytics', { ua: 'X1234567' }],

    // Inline definition
    function () { }
  ]
}

Module developers usually provide additionally needed steps and details for usage.

Nuxt.js tries to resolve each item in the modules array using node require path (in the node_modules) and then will be resolved from project srcDir if ~ alias is used. Modules are executed sequentially so the order is important.

Modules should export a function to enhance nuxt build/runtime and optionally return a promise until their job is finished. Note that they are required at runtime so should be already transpiled if depending on modern ES6 features.

Please see Modules Guide for more detailed information on how they work or if interested developing your own module. Also we have provided an official Modules Section listing dozens of production ready modules made by Nuxt Community.

Vous avez vu une erreur ou vous souhaitez contribuer à la documentation ? Éditez cette page sur GitHub !