API: The globalName Property

Nuxt.js lets you customize the global ID used in the main HTML template as well as the main Vue instance name and other options.

  • Type: String
  • Default: nuxt

Example:

nuxt.config.js

  1. {
  2. globalName: 'myCustomName'
  3. }

It needs to be a valid JavaScript identifier.

The globals property

Customizes specific global names which are based on globalName by default.

  • Type: Object
  • Default:
  1. {
  2. id: globalName => `__${globalName}`,
  3. nuxt: globalName => `$${globalName}`,
  4. context: globalName => `__${globalName.toUpperCase()}__`,
  5. pluginPrefix: globalName => globalName,
  6. readyCallback: globalName => `on${_.capitalize(globalName)}Ready`,
  7. loadedCallback: globalName => `_on${_.capitalize(globalName)}Loaded`
  8. },