Options

To configure the integration, you can use vuems property in the nuxt.config.js:

nuxt.config.js
  export default {
    vuems: {
      // options
    },
  }

modules

  • Type: Object
  • Default:
  {
    npm: [],
    local: []
  }

One of the most important options, which determines which modules are loaded in the project.

Supported options:

  • local - defines local modules, physically placed in the project,
  • npm - defines external modules, hosted on the npm server,
nuxt.config.js
 export default {
   vuems: {
     modules: {
         local: [
           '@demo/core',
           '@cookbook/user',
         ],
     },
   }
 }
nuxt.config.js
 export default {
   vuems: {
     modules: {
         npm: [
           '@test/users',
           '@bleto/import'
         ],
     },
   }
 }
nuxt.config.js
 export default {
   vuems: {
     modules: {
         local: [
           '@demo/core',
           '@cookbook/user',
         ],
         npm: [
           '@test/users',
           '@bleto/import'
         ],
     },
   }
 }
The VueMS library will not start when the property is empty or not specified.

required

  • Type: Array
  • Default: []

Determines the modules needed for the proper functioning of the project.

nuxt.config.js
 export default {
   vuems: {
     required: [ '@demo/core' ]
   }
 }
It is not a required option but quite helpful in case of forcing a specific module to load.

modulesDir

  • Type: String
  • Default: modules

Determines the name of the directory for storing the local modules.

vendorDir

  • Type: String
  • Default: vendor

Directory created by the VueMS mechanism to create symbolic links for npm modules. Directory is temporary and used by symbolic link.

nodeModulesDir

  • Type: String
  • Default: node_modules

Directory where npm packages are installed.

More information here

vuex

  • Type: Boolean
  • Default: false

If Vuex library is used.

i18n

  • Type: Array
  • Default: []

If i18n plugin is used then set array with translations keys used in the application.

nuxt.config.js
 export default {
   vuems: {
     i18n: [
       'en_GB',
       'pl_PL',
     ],
   }
 }
The translator keys are closely related to the translator file names.

i18n translations files

isDev

  • Type: Boolean
  • Default: false

Is development mode on.

nuxt.config.js
 export default {
   vuems: {
     isDev: process.env.NODE_ENV !== 'production',
   }
 }

logLoadedModules

  • Type: Boolean
  • Default: false

Log all loaded module names.

verbose

  • Type: Boolean
  • Default: true

Show VueMS logs

directories

  • Type: Object
  • Default:
{
    assets: 'assets',
    components: 'components',
    config: 'config',
    layouts: 'layouts',
    locales: 'locales',
    middleware: 'middleware',
    pages: 'pages',
    plugins: 'plugins',
    services: 'services',
    store: 'store',
}

Directory structure for module.

More information here

Example

nuxt.config.js
 export default {
   vuems: {
     required: [
         '@demo/core',
     ],
     modules: {
         local: [
           '@demo/core',
           '@cookbook/user',
         ],
         npm: [
           '@test/users',
           '@bleto/import'
         ],
     },
     vuex: true,
     i18n: [
       'en_GB',
       'pl_PL',
     ],
     logLoadedModules: true,
     isDev: process.env.NODE_ENV !== 'production',
   }
 }