Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
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
}