How to use @nuxt/config - 4 common examples

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
}
github nuxt / nuxt.js / packages / core / src / nuxt.js View on Github external
constructor (options = {}) {
    super(consola)

    // Assign options and apply defaults
    this.options = getNuxtConfig(options)

    // Create instance of core components
    this.resolver = new Resolver(this)
    this.moduleContainer = new ModuleContainer(this)

    // Deprecated hooks
    this.deprecateHooks({
      'render:context': 'render:routeContext',
      'render:routeContext': 'vue-renderer:afterRender',
      showReady: 'webpack:done' // Workaround to deprecate showReady
    })

    // Add Legacy aliases
    defineAlias(this, this.resolver, ['resolveAlias', 'resolvePath'])
    this.showReady = () => { this.callHook('webpack:done') }
github nuxt / nuxt.js / packages / core / src / renderer.js View on Github external
get publicPath() {
    return isUrl(this.options.build.publicPath)
      ? NuxtConfig.build.publicPath
      : this.options.build.publicPath
  }

@nuxt/config

MIT
Latest version published 4 months ago

Package Health Score

88 / 100
Full package analysis

Similar packages