How to use the @nuxt/config.getDefaultNuxtConfig function in @nuxt/config

To help you get started, we’ve selected a few @nuxt/config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wagerfield / nuxt-stack / packages / module / index.js View on Github external
export default async function NuxtStack(options) {
  const stack = Object.assign({}, defaults.stack, this.options.stack, options)
  const config = inject(getDefaultNuxtConfig(), this.options)
  const unshift = config(insert("unshift"), true)
  const push = config(insert("push"), true)
  const assign = config(assoc)

  // Defaults
  assign("cache", true)
  assign("hardSource", true)

  // Styles
  if (isNotFalse(stack.normalizeCSS)) unshift("css", "normalize.css")
  push("css", this.options.styles)

  // Head: Language
  assign("head.htmlAttrs.lang", stack.lang)

  // Head: Preconnect Links
github nuxt / nuxt.js / packages / cli / src / utils / config.js View on Github external
}

  if (typeof options.rootDir !== 'string') {
    options.rootDir = rootDir
  }

  // Nuxt Mode
  options.mode =
    (argv.spa && 'spa') || (argv.universal && 'universal') || options.mode

  // Server options
  options.server = defaultsDeep({
    port: argv.port || undefined,
    host: argv.hostname || undefined,
    socket: argv['unix-socket'] || undefined
  }, options.server || {}, getDefaultNuxtConfig().server)

  return options
}

@nuxt/config

MIT
Latest version published 4 months ago

Package Health Score

91 / 100
Full package analysis

Similar packages