���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.1
/
nuxi
/
dist
/
shared
/
Viewing: nuxi.f76c700d.mjs
import { existsSync, promises, lstatSync } from 'node:fs'; import 'node:perf_hooks'; import { d as defu } from './nuxi.eaa29140.mjs'; import { c as consola, C, v, h } from './nuxi.fefc5017.mjs'; import 'node:util'; import 'node:path'; import 'node:process'; import 'node:tty'; import '../chunks/satisfies.mjs'; import { f as findWorkspaceDir, r as readPackageJSON } from './nuxi.de533993.mjs'; import { fileURLToPath } from 'node:url'; import { r as resolvePath$1 } from './nuxi.cd7bfae6.mjs'; import { j as jiti } from './nuxi.88c35b8d.mjs'; import { n as normalizeWindowsPath, j as join, r as resolve, b as basename, a as relative, i as isAbsolute, d as dirname, c as normalize } from './nuxi.610c92ff.mjs'; import { readdir } from 'node:fs/promises'; import nodeCrypto from 'node:crypto'; import { w as withoutLeadingSlash, a as withTrailingSlash } from './nuxi.deb0a220.mjs'; import { s as semver } from './nuxi.15c58622.mjs'; import { t as tryResolveModule$1, i as importModule } from './nuxi.b29fd623.mjs'; function defineUntypedSchema(options) { return options; } function createContext(opts = {}) { let currentInstance; let isSingleton = false; const checkConflict = (instance) => { if (currentInstance && currentInstance !== instance) { throw new Error("Context conflict"); } }; let als; if (opts.asyncContext) { const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage; if (_AsyncLocalStorage) { als = new _AsyncLocalStorage(); } else { console.warn("[unctx] `AsyncLocalStorage` is not provided."); } } const _getCurrentInstance = () => { if (als && currentInstance === void 0) { const instance = als.getStore(); if (instance !== void 0) { return instance; } } return currentInstance; }; return { use: () => { const _instance = _getCurrentInstance(); if (_instance === void 0) { throw new Error("Context is not available"); } return _instance; }, tryUse: () => { return _getCurrentInstance(); }, set: (instance, replace) => { if (!replace) { checkConflict(instance); } currentInstance = instance; isSingleton = true; }, unset: () => { currentInstance = void 0; isSingleton = false; }, call: (instance, callback) => { checkConflict(instance); currentInstance = instance; try { return als ? als.run(instance, callback) : callback(); } finally { if (!isSingleton) { currentInstance = void 0; } } }, async callAsync(instance, callback) { currentInstance = instance; const onRestore = () => { currentInstance = instance; }; const onLeave = () => currentInstance === instance ? onRestore : void 0; asyncHandlers.add(onLeave); try { const r = als ? als.run(instance, callback) : callback(); if (!isSingleton) { currentInstance = void 0; } return await r; } finally { asyncHandlers.delete(onLeave); } } }; } function createNamespace(defaultOpts = {}) { const contexts = {}; return { get(key, opts = {}) { if (!contexts[key]) { contexts[key] = createContext({ ...defaultOpts, ...opts }); } contexts[key]; return contexts[key]; } }; } const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {}; const globalKey = "__unctx__"; const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace()); const getContext = (key, opts = {}) => defaultNamespace.get(key, opts); const asyncHandlersKey = "__unctx_async_handlers__"; const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set()); // A simple implementation of make-array function makeArray (subject) { return Array.isArray(subject) ? subject : [subject] } const EMPTY = ''; const SPACE = ' '; const ESCAPE = '\\'; const REGEX_TEST_BLANK_LINE = /^\s+$/; const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; const REGEX_SPLITALL_CRLF = /\r?\n/g; // /foo, // ./foo, // ../foo, // . // .. const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; const SLASH = '/'; // Do not use ternary expression here, since "istanbul ignore next" is buggy let TMP_KEY_IGNORE = 'node-ignore'; /* istanbul ignore else */ if (typeof Symbol !== 'undefined') { TMP_KEY_IGNORE = Symbol.for('node-ignore'); } const KEY_IGNORE = TMP_KEY_IGNORE; const define = (object, key, value) => Object.defineProperty(object, key, {value}); const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; const RETURN_FALSE = () => false; // Sanitize the range of a regular expression // The cases are complicated, see test cases for details const sanitizeRange = range => range.replace( REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match // Invalid range (out of order) which is ok for gitignore rules but // fatal for JavaScript regular expression, so eliminate it. : EMPTY ); // See fixtures #59 const cleanRangeBackSlash = slashes => { const {length} = slashes; return slashes.slice(0, length - length % 2) }; // > If the pattern ends with a slash, // > it is removed for the purpose of the following description, // > but it would only find a match with a directory. // > In other words, foo/ will match a directory foo and paths underneath it, // > but will not match a regular file or a symbolic link foo // > (this is consistent with the way how pathspec works in general in Git). // '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' // -> ignore-rules will not deal with it, because it costs extra `fs.stat` call // you could use option `mark: true` with `glob` // '`foo/`' should not continue with the '`..`' const REPLACERS = [ [ // remove BOM // TODO: // Other similar zero-width characters? /^\uFEFF/, () => EMPTY ], // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) // (a ) -> (a) // (a ) -> (a) // (a \ ) -> (a ) /((?:\\\\)*?)(\\?\s+)$/, (_, m1, m2) => m1 + ( m2.indexOf('\\') === 0 ? SPACE : EMPTY ) ], // replace (\ ) with ' ' // (\ ) -> ' ' // (\\ ) -> '\\ ' // (\\\ ) -> '\\ ' [ /(\\+?)\s/g, (_, m1) => { const {length} = m1; return m1.slice(0, length - length % 2) + SPACE } ], // Escape metacharacters // which is written down by users but means special for regular expressions. // > There are 12 characters with special meanings: // > - the backslash \, // > - the caret ^, // > - the dollar sign $, // > - the period or dot ., // > - the vertical bar or pipe symbol |, // > - the question mark ?, // > - the asterisk or star *, // > - the plus sign +, // > - the opening parenthesis (, // > - the closing parenthesis ), // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". [ /[\\$.|*+(){^]/g, match => `\\${match}` ], [ // > a question mark (?) matches a single character /(?!\\)\?/g, () => '[^/]' ], // leading slash [ // > A leading slash matches the beginning of the pathname. // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // A leading slash matches the beginning of the pathname /^\//, () => '^' ], // replace special metacharacter slash after the leading slash [ /\//g, () => '\\/' ], [ // > A leading "**" followed by a slash means match in all directories. // > For example, "**/foo" matches file or directory "foo" anywhere, // > the same as pattern "foo". // > "**/foo/bar" matches file or directory "bar" anywhere that is directly // > under directory "foo". // Notice that the '*'s have been replaced as '\\*' /^\^*\\\*\\\*\\\//, // '**/foo' <-> 'foo' () => '^(?:.*\\/)?' ], // starting [ // there will be no leading '/' // (which has been replaced by section "leading slash") // If starts with '**', adding a '^' to the regular expression also works /^(?=[^^])/, function startingReplacer () { // If has a slash `/` at the beginning or middle return !/\/(?!$)/.test(this) // > Prior to 2.22.1 // > If the pattern does not contain a slash /, // > Git treats it as a shell glob pattern // Actually, if there is only a trailing slash, // git also treats it as a shell glob pattern // After 2.22.1 (compatible but clearer) // > If there is a separator at the beginning or middle (or both) // > of the pattern, then the pattern is relative to the directory // > level of the particular .gitignore file itself. // > Otherwise the pattern may also match at any level below // > the .gitignore level. ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for // > consumption by fnmatch(3) : '^' } ], // two globstars [ // Use lookahead assertions so that we could match more than one `'/**'` /\\\/\\\*\\\*(?=\\\/|$)/g, // Zero, one or several directories // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` (_, index, str) => index + 6 < str.length // case: /**/ // > A slash followed by two consecutive asterisks then a slash matches // > zero or more directories. // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. // '/**/' ? '(?:\\/[^\\/]+)*' // case: /** // > A trailing `"/**"` matches everything inside. // #21: everything inside but it should not include the current folder : '\\/.+' ], // normal intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go // 'abc.*' -> skip this rule, // coz trailing single wildcard will be handed by [trailing wildcard] /(^|[^\\]+)(\\\*)+(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' (_, p1, p2) => { // 1. // > An asterisk "*" matches anything except a slash. // 2. // > Other consecutive asterisks are considered regular asterisks // > and will match according to the previous rules. const unescaped = p2.replace(/\\\*/g, '[^\\/]*'); return p1 + unescaped } ], [ // unescape, revert step 3 except for back slash // For example, if a user escape a '\\*', // after step 3, the result will be '\\\\\\*' /\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE ], [ // '\\\\' -> '\\' /\\\\/g, () => ESCAPE ], [ // > The range notation, e.g. [a-zA-Z], // > can be used to match one of the characters in a range. // `\` is escaped by step 3 /(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE // '\\[bar]' -> '\\\\[bar\\]' ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === ']' ? endEscape.length % 2 === 0 // A normal case, and it is a range notation // '[bar]' // '[bar\\\\]' ? `[${sanitizeRange(range)}${endEscape}]` // Invalid range notaton // '[bar\\]' -> '[bar\\\\]' : '[]' : '[]' ], // ending [ // 'js' will not match 'js.' // 'ab' will not match 'abc' /(?:[^*])$/, // WTF! // https://git-scm.com/docs/gitignore // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) // which re-fixes #24, #38 // > If there is a separator at the end of the pattern then the pattern // > will only match directories, otherwise the pattern can match both // > files and directories. // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' match => /\/$/.test(match) // foo/ will not match 'foo' ? `${match}$` // foo matches 'foo' and 'foo/' : `${match}(?=$|\\/$)` ], // trailing wildcard [ /(\^|\\\/)?\\\*$/, (_, p1) => { const prefix = p1 // '\^': // '/*' does not match EMPTY // '/*' does not match everything // '\\\/': // 'abc/*' does not match 'abc/' ? `${p1}[^/]+` // 'a*' matches 'a' // 'a*' matches 'aa' : '[^/]*'; return `${prefix}(?=$|\\/$)` } ], ]; // A simple cache, because an ignore rule only has only one certain meaning const regexCache = Object.create(null); // @param {pattern} const makeRegex = (pattern, ignoreCase) => { let source = regexCache[pattern]; if (!source) { source = REPLACERS.reduce( (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)), pattern ); regexCache[pattern] = source; } return ignoreCase ? new RegExp(source, 'i') : new RegExp(source) }; const isString = subject => typeof subject === 'string'; // > A blank line matches no files, so it can serve as a separator for readability. const checkPattern = pattern => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) // > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0; const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF); class IgnoreRule { constructor ( origin, pattern, negative, regex ) { this.origin = origin; this.pattern = pattern; this.negative = negative; this.regex = regex; } } const createRule = (pattern, ignoreCase) => { const origin = pattern; let negative = false; // > An optional prefix "!" which negates the pattern; if (pattern.indexOf('!') === 0) { negative = true; pattern = pattern.substr(1); } pattern = pattern // > Put a backslash ("\") in front of the first "!" for patterns that // > begin with a literal "!", for example, `"\!important!.txt"`. .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that // > begin with a hash. .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); const regex = makeRegex(pattern, ignoreCase); return new IgnoreRule( origin, pattern, negative, regex ) }; const throwError = (message, Ctor) => { throw new Ctor(message) }; const checkPath = (path, originalPath, doThrow) => { if (!isString(path)) { return doThrow( `path must be a string, but got \`${originalPath}\``, TypeError ) } // We don't know if we should ignore EMPTY, so throw if (!path) { return doThrow(`path must not be empty`, TypeError) } // Check if it is a relative path if (checkPath.isNotRelative(path)) { const r = '`path.relative()`d'; return doThrow( `path should be a ${r} string, but got "${originalPath}"`, RangeError ) } return true }; const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path); checkPath.isNotRelative = isNotRelative; checkPath.convert = p => p; class Ignore { constructor ({ ignorecase = true, ignoreCase = ignorecase, allowRelativePaths = false } = {}) { define(this, KEY_IGNORE, true); this._rules = []; this._ignoreCase = ignoreCase; this._allowRelativePaths = allowRelativePaths; this._initCache(); } _initCache () { this._ignoreCache = Object.create(null); this._testCache = Object.create(null); } _addPattern (pattern) { // #32 if (pattern && pattern[KEY_IGNORE]) { this._rules = this._rules.concat(pattern._rules); this._added = true; return } if (checkPattern(pattern)) { const rule = createRule(pattern, this._ignoreCase); this._added = true; this._rules.push(rule); } } // @param {Array<string> | string | Ignore} pattern add (pattern) { this._added = false; makeArray( isString(pattern) ? splitPattern(pattern) : pattern ).forEach(this._addPattern, this); // Some rules have just added to the ignore, // making the behavior changed. if (this._added) { this._initCache(); } return this } // legacy addPattern (pattern) { return this.add(pattern) } // | ignored : unignored // negative | 0:0 | 0:1 | 1:0 | 1:1 // -------- | ------- | ------- | ------- | -------- // 0 | TEST | TEST | SKIP | X // 1 | TESTIF | SKIP | TEST | X // - SKIP: always skip // - TEST: always test // - TESTIF: only test if checkUnignored // - X: that never happen // @param {boolean} whether should check if the path is unignored, // setting `checkUnignored` to `false` could reduce additional // path matching. // @returns {TestResult} true if a file is ignored _testOne (path, checkUnignored) { let ignored = false; let unignored = false; this._rules.forEach(rule => { const {negative} = rule; if ( unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored ) { return } const matched = rule.regex.test(path); if (matched) { ignored = !negative; unignored = negative; } }); return { ignored, unignored } } // @returns {TestResult} _test (originalPath, cache, checkUnignored, slices) { const path = originalPath // Supports nullable path && checkPath.convert(originalPath); checkPath( path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError ); return this._t(path, cache, checkUnignored, slices) } _t (path, cache, checkUnignored, slices) { if (path in cache) { return cache[path] } if (!slices) { // path/to/a.js // ['path', 'to', 'a.js'] slices = path.split(SLASH); } slices.pop(); // If the path has no parent directory, just test it if (!slices.length) { return cache[path] = this._testOne(path, checkUnignored) } const parent = this._t( slices.join(SLASH) + SLASH, cache, checkUnignored, slices ); // If the path contains a parent directory, check the parent first return cache[path] = parent.ignored // > It is not possible to re-include a file if a parent directory of // > that file is excluded. ? parent : this._testOne(path, checkUnignored) } ignores (path) { return this._test(path, this._ignoreCache, false).ignored } createFilter () { return path => !this.ignores(path) } filter (paths) { return makeArray(paths).filter(this.createFilter()) } // @returns {TestResult} test (path) { return this._test(path, this._testCache, true) } } const factory = options => new Ignore(options); const isPathValid = path => checkPath(path && checkPath.convert(path), path, RETURN_FALSE); factory.isPathValid = isPathValid; // Fixes typescript factory.default = factory; // Windows // -------------------------------------------------------------- /* istanbul ignore if */ if ( // Detect `process` so that it can run in browsers. typeof process !== 'undefined' && ( process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32' ) ) { /* eslint no-control-regex: "off" */ const makePosix = str => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, '/'); checkPath.convert = makePosix; // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' // 'd:\\foo' const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; checkPath.isNotRelative = path => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); } const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]); const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias"); function normalizeAliases(_aliases) { if (_aliases[normalizedAliasSymbol]) { return _aliases; } const aliases = Object.fromEntries( Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b)) ); for (const key in aliases) { for (const alias in aliases) { if (alias === key || key.startsWith(alias)) { continue; } if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) { aliases[key] = aliases[alias] + aliases[key].slice(alias.length); } } } Object.defineProperty(aliases, normalizedAliasSymbol, { value: true, enumerable: false }); return aliases; } function resolveAlias$1(path, aliases) { const _path = normalizeWindowsPath(path); aliases = normalizeAliases(aliases); for (const [alias, to] of Object.entries(aliases)) { if (!_path.startsWith(alias)) { continue; } const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias; if (hasTrailingSlash(_path[_alias.length])) { return join(to, _path.slice(alias.length)); } } return _path; } function _compareAliases(a, b) { return b.split("/").length - a.split("/").length; } function hasTrailingSlash(path = "/") { const lastChar = path[path.length - 1]; return lastChar === "/" || lastChar === "\\"; } nodeCrypto.webcrypto?.subtle || {}; const randomUUID = () => { return nodeCrypto.randomUUID(); }; const adhoc = defineUntypedSchema({ /** * Configure Nuxt component auto-registration. * * Any components in the directories configured here can be used throughout your * pages, layouts (and other components) without needing to explicitly import them. * @see [`components/` directory documentation](https://nuxt.com/docs/guide/directory-structure/components) * @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']} */ components: { $resolve: (val) => { if (Array.isArray(val)) { return { dirs: val }; } if (val === void 0 || val === true) { return { dirs: [{ path: "~/components/global", global: true }, "~/components"] }; } return val; } }, /** * Configure how Nuxt auto-imports composables into your application. * @see [Nuxt documentation](https://nuxt.com/docs/guide/directory-structure/composables) * @type {typeof import('../src/types/imports').ImportsOptions} */ imports: { global: false, /** * An array of custom directories that will be auto-imported. * Note that this option will not override the default directories (~/composables, ~/utils). * @example * ```js * imports: { * // Auto-import pinia stores defined in `~/stores` * dirs: ['stores'] * } * ``` */ dirs: [] }, /** * Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be * enabled if you have a `pages/` directory in your source folder. * @type {boolean} */ pages: void 0, /** * Manually disable nuxt telemetry. * @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information. * @type {boolean | Record<string, any>} */ telemetry: void 0, /** * Enable Nuxt DevTools for development. * * Breaking changes for devtools might not reflect on the version of Nuxt. * @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information. * @type { { enabled: boolean, [key: string]: any } } */ devtools: {} }); const app = defineUntypedSchema({ /** * Vue.js config */ vue: { /** @type {typeof import('@vue/compiler-sfc').AssetURLTagConfig} */ transformAssetUrls: { video: ["src", "poster"], source: ["src"], img: ["src"], image: ["xlink:href", "href"], use: ["xlink:href", "href"] }, /** * Options for the Vue compiler that will be passed at build time. * @see [Vue documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {typeof import('@vue/compiler-core').CompilerOptions} */ compilerOptions: {}, /** * Include Vue compiler in runtime bundle. */ runtimeCompiler: { $resolve: async (val, get) => val ?? await get("experimental.runtimeVueCompiler") ?? false }, /** * Vue Experimental: Enable reactive destructure for `defineProps` * @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502) * @type {boolean} */ propsDestructure: false }, /** * Nuxt App configuration. */ app: { /** * The base path of your Nuxt application. * * For example: * @example * ```ts * export default defineNuxtConfig({ * app: { * baseURL: '/prefix/' * } * }) * ``` * * This can also be set at runtime by setting the NUXT_APP_BASE_URL environment variable. * @example * ```bash * NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs * ``` */ baseURL: { $resolve: (val) => val || process.env.NUXT_APP_BASE_URL || "/" }, /** The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime. */ buildAssetsDir: { $resolve: (val) => val || process.env.NUXT_APP_BUILD_ASSETS_DIR || "/_nuxt/" }, /** * An absolute URL to serve the public folder from (production-only). * * For example: * @example * ```ts * export default defineNuxtConfig({ * app: { * cdnURL: 'https://mycdn.org/' * } * }) * ``` * * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. * @example * ```bash * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs * ``` */ cdnURL: { $resolve: async (val, get) => await get("dev") ? "" : (process.env.NUXT_APP_CDN_URL ?? val) || "" }, /** * Set default configuration for `<head>` on every page. * @example * ```js * app: { * head: { * meta: [ * // <meta name="viewport" content="width=device-width, initial-scale=1"> * { name: 'viewport', content: 'width=device-width, initial-scale=1' } * ], * script: [ * // <script src="https://myawesome-lib.js"><\/script> * { src: 'https://awesome-lib.js' } * ], * link: [ * // <link rel="stylesheet" href="https://myawesome-lib.css"> * { rel: 'stylesheet', href: 'https://awesome-lib.css' } * ], * // please note that this is an area that is likely to change * style: [ * // <style type="text/css">:root { color: red }</style> * { children: ':root { color: red }', type: 'text/css' } * ], * noscript: [ * // <noscript>JavaScript is required</noscript> * { children: 'JavaScript is required' } * ] * } * } * ``` * @type {typeof import('../src/types/config').NuxtAppConfig['head']} */ head: { $resolve: async (val, get) => { const resolved = defu(val, await get("meta"), { meta: [], link: [], style: [], script: [], noscript: [] }); if (!resolved.meta.find((m) => m.charset)?.charset) { resolved.meta.unshift({ charset: resolved.charset || "utf-8" }); } if (!resolved.meta.find((m) => m.name === "viewport")?.content) { resolved.meta.unshift({ name: "viewport", content: resolved.viewport || "width=device-width, initial-scale=1" }); } resolved.meta = resolved.meta.filter(Boolean); resolved.link = resolved.link.filter(Boolean); resolved.style = resolved.style.filter(Boolean); resolved.script = resolved.script.filter(Boolean); resolved.noscript = resolved.noscript.filter(Boolean); return resolved; } }, /** * Default values for layout transitions. * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition) * @type {typeof import('../src/types/config').NuxtAppConfig['layoutTransition']} */ layoutTransition: false, /** * Default values for page transitions. * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition) * @type {typeof import('../src/types/config').NuxtAppConfig['pageTransition']} */ pageTransition: false, /** * Default values for view transitions. * * This only has an effect when **experimental** support for View Transitions is * [enabled in your nuxt.config file](/docs/getting-started/transitions#view-transitions-api-experimental). * * This can be overridden with `definePageMeta` on an individual page. * @see [Nuxt View Transition API docs](https://nuxt.com/docs/getting-started/transitions#view-transitions-api-experimental) * @type {typeof import('../src/types/config').NuxtAppConfig['viewTransition']} */ viewTransition: { $resolve: async (val, get) => val ?? await get("experimental").then( (e) => e?.viewTransition ) ?? false }, /** * Default values for KeepAlive configuration between pages. * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. * @see [Vue KeepAlive](https://vuejs.org/api/built-in-components.html#keepalive) * @type {typeof import('../src/types/config').NuxtAppConfig['keepalive']} */ keepalive: false, /** * Customize Nuxt root element id. * @type {string | false} * @deprecated Prefer `rootAttrs.id` instead */ rootId: { $resolve: (val) => val === false ? false : val || "__nuxt" }, /** * Customize Nuxt root element tag. */ rootTag: { $resolve: (val) => val || "div" }, /** * Customize Nuxt root element id. * @type {typeof import('@unhead/schema').HtmlAttributes} */ rootAttrs: { $resolve: async (val, get) => { const rootId = await get("app.rootId"); return defu(val, { id: rootId === false ? void 0 : rootId || "__nuxt" }); } }, /** * Customize Nuxt root element tag. */ teleportTag: { $resolve: (val) => val || "div" }, /** * Customize Nuxt Teleport element id. * @type {string | false} * @deprecated Prefer `teleportAttrs.id` instead */ teleportId: { $resolve: (val) => val === false ? false : val || "teleports" }, /** * Customize Nuxt Teleport element attributes. * @type {typeof import('@unhead/schema').HtmlAttributes} */ teleportAttrs: { $resolve: async (val, get) => { const teleportId = await get("app.teleportId"); return defu(val, { id: teleportId === false ? void 0 : teleportId || "teleports" }); } } }, /** * Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page * rendered with `ssr: false`. * * - If it is unset, it will use `~/app/spa-loading-template.html` file in one of your layers, if it exists. * - If it is false, no SPA loading indicator will be loaded. * - If true, Nuxt will look for `~/app/spa-loading-template.html` file in one of your layers, or a * default Nuxt image will be used. * * Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners). * @example ~/app/spa-loading-template.html * ```html * <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md --> * <div class="loader"></div> * <style> * .loader { * display: block; * position: fixed; * z-index: 1031; * top: 50%; * left: 50%; * transform: translate(-50%, -50%); * width: 18px; * height: 18px; * box-sizing: border-box; * border: solid 2px transparent; * border-top-color: #000; * border-left-color: #000; * border-bottom-color: #efefef; * border-right-color: #efefef; * border-radius: 50%; * -webkit-animation: loader 400ms linear infinite; * animation: loader 400ms linear infinite; * } * * \@-webkit-keyframes loader { * 0% { * -webkit-transform: translate(-50%, -50%) rotate(0deg); * } * 100% { * -webkit-transform: translate(-50%, -50%) rotate(360deg); * } * } * \@keyframes loader { * 0% { * transform: translate(-50%, -50%) rotate(0deg); * } * 100% { * transform: translate(-50%, -50%) rotate(360deg); * } * } * </style> * ``` * @type {string | boolean} */ spaLoadingTemplate: { $resolve: async (val, get) => typeof val === "string" ? resolve(await get("srcDir"), val) : val ?? null }, /** * An array of nuxt app plugins. * * Each plugin can be a string (which can be an absolute or relative path to a file). * If it ends with `.client` or `.server` then it will be automatically loaded only * in the appropriate context. * * It can also be an object with `src` and `mode` keys. * @note Plugins are also auto-registered from the `~/plugins` directory * and these plugins do not need to be listed in `nuxt.config` unless you * need to customize their order. All plugins are deduplicated by their src path. * @see [`plugins/` directory documentation](https://nuxt.com/docs/guide/directory-structure/plugins) * @example * ```js * plugins: [ * '~/plugins/foo.client.js', // only in client side * '~/plugins/bar.server.js', // only in server side * '~/plugins/baz.js', // both client & server * { src: '~/plugins/both-sides.js' }, * { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side * { src: '~/plugins/server-only.js', mode: 'server' } // only on server side * ] * ``` * @type {(typeof import('../src/types/nuxt').NuxtPlugin | string)[]} */ plugins: [], /** * You can define the CSS files/modules/libraries you want to set globally * (included in every page). * * Nuxt will automatically guess the file type by its extension and use the * appropriate pre-processor. You will still need to install the required * loader if you need to use them. * @example * ```js * css: [ * // Load a Node.js module directly (here it's a Sass file). * 'bulma', * // CSS file in the project * '~/assets/css/main.css', * // SCSS file in the project * '~/assets/css/main.scss' * ] * ``` * @type {string[]} */ css: { $resolve: (val) => (val ?? []).map((c) => c.src || c) }, /** * An object that allows us to configure the `unhead` nuxt module. */ unhead: { /** * An object that will be passed to `renderSSRHead` to customize the output. * * @see [`unhead` options documentation](https://unhead.unjs.io/setup/ssr/installation#options) * * @example * ```ts * export default defineNuxtConfig({ * unhead: { * renderSSRHeadOptions: { * omitLineBreaks: true * } * }) * ``` * @type {typeof import('@unhead/schema').RenderSSRHeadOptions} */ renderSSRHeadOptions: { $resolve: async (val, get) => { const isV4 = (await get("future")).compatibilityVersion === 4; return defu(val, { omitLineBreaks: isV4 }); } } } }); const build = defineUntypedSchema({ /** * The builder to use for bundling the Vue part of your application. * @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }} */ builder: { $resolve: async (val = "vite", get) => { if (typeof val === "object") { return val; } const map = { vite: "@nuxt/vite-builder", webpack: "@nuxt/webpack-builder" }; return map[val] || val || (await get("vite") === false ? map.webpack : map.vite); } }, /** * Whether to generate sourcemaps. * @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }} */ sourcemap: { $resolve: async (val, get) => { if (typeof val === "boolean") { return { server: val, client: val }; } return defu(val, { server: true, client: await get("dev") }); } }, /** * Log level when building logs. * * Defaults to 'silent' when running in CI or when a TTY is not available. * This option is then used as 'silent' in Vite and 'none' in Webpack * @type {'silent' | 'info' | 'verbose'} */ logLevel: { $resolve: (val) => { if (val && !["silent", "info", "verbose"].includes(val)) { consola.warn(`Invalid \`logLevel\` option: \`${val}\`. Must be one of: \`silent\`, \`info\`, \`verbose\`.`); } return val ?? (C ? "silent" : "info"); } }, /** * Shared build configuration. */ build: { /** * If you want to transpile specific dependencies with Babel, you can add them here. * Each item in transpile can be a package name, a function, a string or regex object matching the * dependency's file name. * * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). * @example * ```js * transpile: [({ isLegacy }) => isLegacy && 'ky'] * ``` * @type {Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>} */ transpile: { $resolve: (val) => (val || []).filter(Boolean) }, /** * You can provide your own templates which will be rendered based * on Nuxt configuration. This feature is specially useful for using with modules. * * Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). * @example * ```js * templates: [ * { * src: '~/modules/support/plugin.js', // `src` can be absolute or relative * dst: 'support.js', // `dst` is relative to project `.nuxt` dir * options: { * // Options are provided to template as `options` key * live_chat: false * } * } * ] * ``` * @type {typeof import('../src/types/nuxt').NuxtTemplate<any>[]} */ templates: [], /** * Nuxt allows visualizing your bundles and how to optimize them. * * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). * @example * ```js * analyze: { * analyzerMode: 'static' * } * ``` * @type {boolean | { enabled?: boolean } & ((0 extends 1 & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options ? {} : typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options) | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions)} */ analyze: { $resolve: async (val, get) => { const [rootDir, analyzeDir] = await Promise.all([get("rootDir"), get("analyzeDir")]); return defu(typeof val === "boolean" ? { enabled: val } : val, { template: "treemap", projectRoot: rootDir, filename: join(analyzeDir, "{name}.html") }); } } }, /** * Build time optimization configuration. */ optimization: { /** * Functions to inject a key for. * * As long as the number of arguments passed to the function is less than `argumentLength`, an * additional magic string will be injected that can be used to deduplicate requests between server * and client. You will need to take steps to handle this additional key. * * The key will be unique based on the location of the function being invoked within the file. * @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>} */ keyedComposables: { $resolve: (val) => [ { name: "useId", argumentLength: 1 }, { name: "callOnce", argumentLength: 2 }, { name: "defineNuxtComponent", argumentLength: 2 }, { name: "useState", argumentLength: 2 }, { name: "useFetch", argumentLength: 3 }, { name: "useAsyncData", argumentLength: 3 }, { name: "useLazyAsyncData", argumentLength: 3 }, { name: "useLazyFetch", argumentLength: 3 }, ...val || [] ].filter(Boolean) }, /** * Tree shake code from specific builds. */ treeShake: { /** * Tree shake composables from the server or client builds. * @example * ```js * treeShake: { client: { myPackage: ['useServerOnlyComposable'] } } * ``` */ composables: { server: { $resolve: async (val, get) => defu( val || {}, await get("dev") ? {} : { "vue": ["onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated"], "#app": ["definePayloadReviver", "definePageMeta"] } ) }, client: { $resolve: async (val, get) => defu( val || {}, await get("dev") ? {} : { "vue": ["onRenderTracked", "onRenderTriggered", "onServerPrefetch"], "#app": ["definePayloadReducer", "definePageMeta", "onPrehydrate"] } ) } } }, /** * Options passed directly to the transformer from `unctx` that preserves async context * after `await`. * @type {typeof import('unctx/transform').TransformerOptions} */ asyncTransforms: { asyncFunctions: ["defineNuxtPlugin", "defineNuxtRouteMiddleware"], objectDefinitions: { defineNuxtComponent: ["asyncData", "setup"], defineNuxtPlugin: ["setup"], definePageMeta: ["middleware", "validate"] } } } }); const common = defineUntypedSchema({ /** * Extend project from multiple local or remote sources. * * Value should be either a string or array of strings pointing to source directories or config path relative to current config. * * You can use `github:`, `gh:` `gitlab:` or `bitbucket:` * @see [`c12` docs on extending config layers](https://github.com/unjs/c12#extending-config-layer-from-remote-sources) * @see [`giget` documentation](https://github.com/unjs/giget) * @type {string | [string, typeof import('c12').SourceOptions?] | (string | [string, typeof import('c12').SourceOptions?])[]} */ extends: null, /** * Specify a compatibility date for your app. * * This is used to control the behavior of presets in Nitro, Nuxt Image * and other modules that may change behavior without a major version bump. * * We plan to improve the tooling around this feature in the future. * * @type {typeof import('compatx').CompatibilityDateSpec} */ compatibilityDate: void 0, /** * Extend project from a local or remote source. * * Value should be a string pointing to source directory or config path relative to current config. * * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. * @type {string} */ theme: null, /** * Define the root directory of your application. * * This property can be overwritten (for example, running `nuxt ./my-app/` * will set the `rootDir` to the absolute path of `./my-app/` from the * current/working directory. * * It is normally not needed to configure this option. */ rootDir: { $resolve: (val) => typeof val === "string" ? resolve(val) : process.cwd() }, /** * Define the workspace directory of your application. * * Often this is used when in a monorepo setup. Nuxt will attempt to detect * your workspace directory automatically, but you can override it here. * * It is normally not needed to configure this option. */ workspaceDir: { $resolve: async (val, get) => { const rootDir = await get("rootDir"); return val ? resolve(rootDir, val) : await findWorkspaceDir(rootDir).catch(() => rootDir); } }, /** * Define the source directory of your Nuxt application. * * If a relative path is specified, it will be relative to the `rootDir`. * @example * ```js * export default { * srcDir: 'src/' * } * ``` * This would work with the following folder structure: * ```bash * -| app/ * ---| node_modules/ * ---| nuxt.config.js * ---| package.json * ---| src/ * ------| assets/ * ------| components/ * ------| layouts/ * ------| middleware/ * ------| pages/ * ------| plugins/ * ------| public/ * ------| store/ * ------| server/ * ------| app.config.ts * ------| app.vue * ------| error.vue * ``` */ srcDir: { $resolve: async (val, get) => { if (val) { return resolve(await get("rootDir"), val); } const [rootDir, isV4] = await Promise.all([ get("rootDir"), get("future").then((r) => r.compatibilityVersion === 4) ]); if (!isV4) { return rootDir; } const srcDir = resolve(rootDir, "app"); if (!existsSync(srcDir)) { return rootDir; } const srcDirFiles = /* @__PURE__ */ new Set(); const files = await readdir(srcDir).catch(() => []); for (const file of files) { if (file !== "spa-loading-template.html" && !file.startsWith("router.options")) { srcDirFiles.add(file); } } if (srcDirFiles.size === 0) { for (const file of ["app.vue", "App.vue"]) { if (existsSync(resolve(rootDir, file))) { return rootDir; } } const keys = ["assets", "layouts", "middleware", "pages", "plugins"]; const dirs = await Promise.all(keys.map((key) => get(`dir.${key}`))); for (const dir of dirs) { if (existsSync(resolve(rootDir, dir))) { return rootDir; } } } return srcDir; } }, /** * Define the server directory of your Nuxt application, where Nitro * routes, middleware and plugins are kept. * * If a relative path is specified, it will be relative to your `rootDir`. * */ serverDir: { $resolve: async (val, get) => { const isV4 = (await get("future")).compatibilityVersion === 4; return resolve(isV4 ? await get("rootDir") : await get("srcDir"), val ?? "server"); } }, /** * Define the directory where your built Nuxt files will be placed. * * Many tools assume that `.nuxt` is a hidden directory (because it starts * with a `.`). If that is a problem, you can use this option to prevent that. * @example * ```js * export default { * buildDir: 'nuxt-build' * } * ``` */ buildDir: { $resolve: async (val, get) => resolve(await get("rootDir"), val || ".nuxt") }, /** * For multi-app projects, the unique id of the Nuxt application. * * Defaults to `nuxt-app`. */ appId: { $resolve: (val) => val ?? "nuxt-app" }, /** * A unique identifier matching the build. This may contain the hash of the current state of the project. */ buildId: { $resolve: async (val, get) => { if (typeof val === "string") { return val; } const [isDev, isTest2] = await Promise.all([get("dev"), get("test")]); return isDev ? "dev" : isTest2 ? "test" : randomUUID(); } }, /** * Used to set the modules directories for path resolving (for example, webpack's * `resolveLoading`, `nodeExternals` and `postcss`). * * The configuration path is relative to `options.rootDir` (default is current working directory). * * Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository. * @example * ```js * export default { * modulesDir: ['../../node_modules'] * } * ``` */ modulesDir: { $default: ["node_modules"], $resolve: async (val, get) => { const rootDir = await get("rootDir"); return [.../* @__PURE__ */ new Set([ ...(val || []).map((dir) => resolve(rootDir, dir)), resolve(rootDir, "node_modules") ])]; } }, /** * The directory where Nuxt will store the generated files when running `nuxt analyze`. * * If a relative path is specified, it will be relative to your `rootDir`. */ analyzeDir: { $resolve: async (val, get) => val ? resolve(await get("rootDir"), val) : resolve(await get("buildDir"), "analyze") }, /** * Whether Nuxt is running in development mode. * * Normally, you should not need to set this. */ dev: Boolean(v), /** * Whether your app is being unit tested. */ test: Boolean(C), /** * Set to `true` to enable debug mode. * * At the moment, it prints out hook names and timings on the server, and * logs hook arguments as well in the browser. * */ debug: { $resolve: (val) => val ?? h }, /** * Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. * If set to `false` generated pages will have no content. */ ssr: { $resolve: (val) => val ?? true }, /** * Modules are Nuxt extensions which can extend its core functionality and add endless integrations. * * Each module is either a string (which can refer to a package, or be a path to a file), a * tuple with the module as first string and the options as a second object, or an inline module function. * * Nuxt tries to resolve each item in the modules array using node require path * (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used. * @note Modules are executed sequentially so the order is important. First, the modules defined in `nuxt.config.ts` are loaded. Then, modules found in the `modules/` * directory are executed, and they load in alphabetical order. * @example * ```js * modules: [ * // Using package name * '@nuxtjs/axios', * // Relative to your project srcDir * '~/modules/awesome.js', * // Providing options * ['@nuxtjs/google-analytics', { ua: 'X1234567' }], * // Inline definition * function () {} * ] * ``` * @type {(typeof import('../src/types/module').NuxtModule | string | [typeof import('../src/types/module').NuxtModule | string, Record<string, any>] | undefined | null | false)[]} */ modules: { $resolve: (val) => (val || []).filter(Boolean) }, /** * Customize default directory structure used by Nuxt. * * It is better to stick with defaults unless needed. */ dir: { app: { $resolve: async (val, get) => { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4) { const [srcDir, rootDir] = await Promise.all([get("srcDir"), get("rootDir")]); return resolve(await get("srcDir"), val || (srcDir === rootDir ? "app" : ".")); } return val || "app"; } }, /** * The assets directory (aliased as `~assets` in your build). */ assets: "assets", /** * The layouts directory, each file of which will be auto-registered as a Nuxt layout. */ layouts: "layouts", /** * The middleware directory, each file of which will be auto-registered as a Nuxt middleware. */ middleware: "middleware", /** * The modules directory, each file in which will be auto-registered as a Nuxt module. */ modules: { $resolve: async (val, get) => { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4) { return resolve(await get("rootDir"), val || "modules"); } return val || "modules"; } }, /** * The directory which will be processed to auto-generate your application page routes. */ pages: "pages", /** * The plugins directory, each file of which will be auto-registered as a Nuxt plugin. */ plugins: "plugins", /** * The directory containing your static files, which will be directly accessible via the Nuxt server * and copied across into your `dist` folder when your app is generated. */ public: { $resolve: async (val, get) => { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4) { return resolve(await get("rootDir"), val || await get("dir.static") || "public"); } return val || await get("dir.static") || "public"; } }, static: { $schema: { deprecated: "use `dir.public` option instead" }, $resolve: async (val, get) => val || await get("dir.public") || "public" } }, /** * The extensions that should be resolved by the Nuxt resolver. */ extensions: { $resolve: (val) => [".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue", ...val || []].filter(Boolean) }, /** * You can improve your DX by defining additional aliases to access custom directories * within your JavaScript and CSS. * @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access * your alias by prefixing it with `~`. * @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full * type support and path auto-complete. In case you need to extend options provided by `./.nuxt/tsconfig.json` * further, make sure to add them here or within the `typescript.tsConfig` property in `nuxt.config`. * @example * ```js * export default { * alias: { * 'images': fileURLToPath(new URL('./assets/images', import.meta.url)), * 'style': fileURLToPath(new URL('./assets/style', import.meta.url)), * 'data': fileURLToPath(new URL('./assets/other/data', import.meta.url)) * } * } * ``` * * ```html * <template> * <img src="~images/main-bg.jpg"> * </template> * * <script> * import data from 'data/test.json' * <\/script> * * <style> * // Uncomment the below * //@import '~style/variables.scss'; * //@import '~style/utils.scss'; * //@import '~style/base.scss'; * body { * background-image: url('~images/main-bg.jpg'); * } * </style> * ``` * @type {Record<string, string>} */ alias: { $resolve: async (val, get) => { const [srcDir, rootDir, assetsDir, publicDir] = await Promise.all([get("srcDir"), get("rootDir"), get("dir.assets"), get("dir.public")]); return { "~": srcDir, "@": srcDir, "~~": rootDir, "@@": rootDir, [basename(assetsDir)]: resolve(srcDir, assetsDir), [basename(publicDir)]: resolve(srcDir, publicDir), ...val }; } }, /** * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files). * @see [node-ignore](https://github.com/kaelzhang/node-ignore) * @example * ```js * ignoreOptions: { * ignorecase: false * } * ``` * @type {typeof import('ignore').Options} */ ignoreOptions: void 0, /** * Any file in `pages/`, `layouts/`, `middleware/`, and `public/` directories will be ignored during * the build process if its filename starts with the prefix specified by `ignorePrefix`. This is intended to prevent * certain files from being processed or served in the built application. * By default, the `ignorePrefix` is set to '-', ignoring any files starting with '-'. */ ignorePrefix: { $resolve: (val) => val ?? "-" }, /** * More customizable than `ignorePrefix`: all files matching glob patterns specified * inside the `ignore` array will be ignored in building. */ ignore: { $resolve: async (val, get) => { const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([get("rootDir"), get("ignorePrefix"), get("analyzeDir"), get("buildDir")]); return [ "**/*.stories.{js,cts,mts,ts,jsx,tsx}", // ignore storybook files "**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}", // ignore tests "**/*.d.{cts,mts,ts}", // ignore type declarations "**/.{pnpm-store,vercel,netlify,output,git,cache,data}", relative(rootDir, analyzeDir), relative(rootDir, buildDir), ignorePrefix && `**/${ignorePrefix}*.*`, ...val || [] ].filter(Boolean); } }, /** * The watch property lets you define patterns that will restart the Nuxt dev server when changed. * * It is an array of strings or regular expressions. Strings should be either absolute paths or * relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched * against the path relative to the project `srcDir` (and the `srcDir` of any layers). * @type {Array<string | RegExp>} */ watch: { $resolve: (val) => { return (val || []).filter((b) => typeof b === "string" || b instanceof RegExp); } }, /** * The watchers property lets you overwrite watchers configuration in your `nuxt.config`. */ watchers: { /** An array of event types, which, when received, will cause the watcher to restart. */ rewatchOnRawEvents: void 0, /** * `watchOptions` to pass directly to webpack. * @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions). */ webpack: { aggregateTimeout: 1e3 }, /** * Options to pass directly to `chokidar`. * @see [chokidar](https://github.com/paulmillr/chokidar#api) */ chokidar: { ignoreInitial: true } }, /** * Hooks are listeners to Nuxt events that are typically used in modules, * but are also available in `nuxt.config`. * * Internally, hooks follow a naming pattern using colons (e.g., build:done). * * For ease of configuration, you can also structure them as an hierarchical * object in `nuxt.config` (as below). * @example * ```js * import fs from 'node:fs' * import path from 'node:path' * export default { * hooks: { * build: { * done(builder) { * const extraFilePath = path.join( * builder.nuxt.options.buildDir, * 'extra-file' * ) * fs.writeFileSync(extraFilePath, 'Something extra') * } * } * } * } * ``` * @type {typeof import('../src/types/hooks').NuxtHooks} */ hooks: null, /** * Runtime config allows passing dynamic config and environment variables to the Nuxt app context. * * The value of this object is accessible from server only using `useRuntimeConfig`. * * It mainly should hold _private_ configuration which is not exposed on the frontend. * This could include a reference to your API secret tokens. * * Anything under `public` and `app` will be exposed to the frontend as well. * * Values are automatically replaced by matching env variables at runtime, e.g. setting an environment * variable `NUXT_API_KEY=my-api-key NUXT_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below. * @example * ```js * export default { * runtimeConfig: { * apiKey: '', // Default to an empty string, automatically set at runtime using process.env.NUXT_API_KEY * public: { * baseURL: '' // Exposed to the frontend as well. * } * } * } * ``` * @type {typeof import('../src/types/config').RuntimeConfig} */ runtimeConfig: { $resolve: async (val, get) => { const [app, buildId] = await Promise.all([get("app"), get("buildId")]); provideFallbackValues(val); return defu(val, { public: {}, app: { buildId, baseURL: app.baseURL, buildAssetsDir: app.buildAssetsDir, cdnURL: app.cdnURL } }); } }, /** * Additional app configuration * * For programmatic usage and type support, you can directly provide app config with this option. * It will be merged with `app.config` file as default value. * @type {typeof import('../src/types/config').AppConfig} */ appConfig: { nuxt: {} }, $schema: {} }); function provideFallbackValues(obj) { for (const key in obj) { if (typeof obj[key] === "undefined" || obj[key] === null) { obj[key] = ""; } else if (typeof obj[key] === "object") { provideFallbackValues(obj[key]); } } } const _messages = { "appName": "Nuxt", "version": "", "loading": "Loading" }; const template = (messages) => { messages = { ..._messages, ...messages }; return '<!DOCTYPE html><html lang="en"><head><title>' + messages.loading + " | " + messages.appName + `</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1,minimum-scale=1" name="viewport"><style>.nuxt-loader-bar{background:repeating-linear-gradient(to right, #36E4DA 0%, #1DE0B1 25%, #00DC82 50%, #1DE0B1 75%, #36E4DA 100%);height:100px;background-size:200% auto;background-position:0 0;animation:gradient 2s infinite;animation-fill-mode:forwards;animation-timing-function:linear;position:fixed;bottom:0;left:0;right:0;height:5px}.visual-effects .nuxt-loader-bar{height:100px;bottom:-50px;left:-50px;right:-50px;filter:blur(100px)}.visual-effects .mouse-gradient{background:repeating-linear-gradient(to right, #00DC82 0%, #1DE0B1 50%, #36E4DA 100%);filter:blur(100px);opacity:0.5}#animation-toggle{position:fixed;padding:10px;top:0;right:0;transition:opacity 0.4s ease-in;opacity:0}#animation-toggle:hover{opacity:0.8}@keyframes gradient{0%{background-position:0 0}100%{background-position:-200% 0}}@media (prefers-color-scheme: dark){html,body{color:white;color-scheme:dark}.nuxt-loader-bar{opacity:0.5}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}a{color:inherit;text-decoration:inherit}button{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button{text-transform:none}button,[type=button]{-webkit-appearance:button;background-color:transparent;background-image:none}button{cursor:pointer}svg{display:block;vertical-align:middle}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.relative{position:relative}.top-0{top:0}.z-20{z-index:20}.h-\\[200px\\]{height:200px}.min-h-screen{min-height:100vh}.w-\\[200px\\]{width:200px}.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.text-center{text-align:center}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media (prefers-color-scheme: dark){.dark\\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0 / var(--un-bg-opacity))}}</style><script>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();<\/script></head><body class="visual-effects relative overflow-hidden min-h-screen bg-white dark:bg-black flex flex-col justify-center items-center text-center"><div id="mouseLight" class="absolute top-0 rounded-full mouse-gradient transition-opacity h-[200px] w-[200px]"></div><a href="https://nuxt.com" target="_blank" rel="noopener" class="nuxt-logo z-20" aria-label="Nuxt"><svg id="nuxtImg" xmlns="http://www.w3.org/2000/svg" width="214" height="53" fill="none" viewBox="0 0 800 200"><path fill="#00DC82" d="M168.303 200h111.522c3.543 0 7.022-.924 10.09-2.679A20.086 20.086 0 0 0 297.3 190a19.855 19.855 0 0 0 2.7-10.001 19.858 19.858 0 0 0-2.709-9.998L222.396 41.429a20.09 20.09 0 0 0-7.384-7.32 20.313 20.313 0 0 0-10.088-2.679c-3.541 0-7.02.925-10.087 2.68a20.082 20.082 0 0 0-7.384 7.32l-19.15 32.896L130.86 9.998a20.086 20.086 0 0 0-7.387-7.32A20.322 20.322 0 0 0 113.384 0c-3.542 0-7.022.924-10.09 2.679a20.091 20.091 0 0 0-7.387 7.319L2.709 170A19.853 19.853 0 0 0 0 179.999c-.002 3.511.93 6.96 2.7 10.001a20.091 20.091 0 0 0 7.385 7.321A20.322 20.322 0 0 0 20.175 200h70.004c27.737 0 48.192-12.075 62.266-35.633l34.171-58.652 18.303-31.389 54.93 94.285h-73.233L168.303 200Zm-79.265-31.421-48.854-.011 73.232-125.706 36.541 62.853-24.466 42.01c-9.347 15.285-19.965 20.854-36.453 20.854Z"/><path fill="currentColor" d="M377 200a4 4 0 0 0 4-4v-93s5.244 8.286 15 25l38.707 66.961c1.789 3.119 5.084 5.039 8.649 5.039H470V50h-27a4 4 0 0 0-4 4v94l-17-30-36.588-62.98c-1.792-3.108-5.081-5.02-8.639-5.02H350v150h27ZM676.203 143.857 710.551 92h-25.73a9.972 9.972 0 0 0-8.333 4.522L660.757 120.5l-15.731-23.978A9.972 9.972 0 0 0 636.693 92h-25.527l34.348 51.643L608.524 200h24.966a9.969 9.969 0 0 0 8.29-4.458l19.18-28.756 18.981 28.72a9.968 9.968 0 0 0 8.313 4.494h24.736l-36.787-56.143ZM724.598 92h19.714V60.071h28.251V92H800v24.857h-27.437V159.5c0 10.5 5.284 15.429 14.43 15.429H800V200h-16.869c-23.576 0-38.819-14.143-38.819-39.214v-43.929h-19.714V92ZM590 92h-15c-3.489 0-6.218.145-8.5 2.523-2.282 2.246-2.5 3.63-2.5 7.066v52.486c0 8.058-.376 12.962-4 16.925-3.624 3.831-8.619 5-16 5-7.247 0-12.376-1.169-16-5-3.624-3.963-4-8.867-4-16.925v-52.486c0-3.435-.218-4.82-2.5-7.066C519.218 92.145 516.489 92 513 92h-15v62.422c0 14.004 3.892 25.101 11.676 33.292C517.594 195.905 529.103 200 544 200c14.897 0 26.204-4.095 34.123-12.286 7.918-8.191 11.877-19.288 11.877-33.292V92Z"/></svg> </a><button id="animation-toggle" type="button">Animation Enabled</button><div class="nuxt-loader-bar"></div><script>const ANIMATION_KEY = 'nuxt-loading-enable-animation' const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) let isLowPerformance = checkIsLowPerformance() let enableAnimation = localStorage.getItem(ANIMATION_KEY) === 'false' ? false : localStorage.getItem(ANIMATION_KEY) === 'true' ? true : !isLowPerformance const mouseLight = window.document.getElementById('mouseLight') const nuxtImg = window.document.getElementById('nuxtImg') const animationToggle = window.document.getElementById('animation-toggle') const body = window.document.body let bodyRect function checkIsLowPerformance() { return window.matchMedia('(prefers-reduced-motion: reduce)').matches || navigator.hardwareConcurrency < 2 || navigator.deviceMemory < 1 // Safari has some performance issue on the blur filter. Remove this when it's fixed. || isSafari } function calculateDistance(elem, mouseX, mouseY) { return Math.floor(Math.sqrt(Math.pow(mouseX - (elem.x + (elem.width / 2)), 2) + Math.pow(mouseY - (elem.top + (elem.height / 2)), 2))); } function onFocusOut() { if (!enableAnimation) { return } mouseLight.style.opacity = 0 nuxtImg.style.opacity = 0.7 } function onMouseMove(e) { if (!enableAnimation) { return } const pointerRect = nuxtImg.getBoundingClientRect() if (!bodyRect) { bodyRect = body.getBoundingClientRect() } const distance = calculateDistance(pointerRect, e.pageX, e.pageY) const size = Math.max((1000 - distance) / 2 / 100, 1) mouseLight.style.top = \`\${e.clientY - bodyRect.y - mouseLight.clientHeight / 2}px\` mouseLight.style.left = \`\${e.clientX - mouseLight.clientWidth / 2}px\` mouseLight.style.width = mouseLight.style.height = \`\${Math.max(Math.round(size * 100), 300)}px\` mouseLight.style.filter = \`blur(\${Math.min(Math.max(size * 50, 100), 160)}px)\` mouseLight.style.opacity = Math.min(Math.max(size / 4, 0.6), 1) const dx = e.pageX - pointerRect.left const dy = e.pageY - pointerRect.top const logoGradient = \`radial-gradient(circle at \${dx}px \${dy}px, black 75%, transparent 100%)\` nuxtImg.style['-webkit-mask-image'] = logoGradient nuxtImg.style['mask-image'] = logoGradient nuxtImg.style.opacity = Math.min(Math.max(size / 4, 0.7), 1) } function toggleAnimation(value = !enableAnimation) { enableAnimation = value document.body.classList.toggle('visual-effects', enableAnimation) if (value) { onFocusOut() animationToggle.innerText = 'Animation Enabled' } else { mouseLight.style.opacity = 0 nuxtImg.style.opacity = 1 nuxtImg.style['mask-image'] = '' nuxtImg.style['-webkit-mask-image'] = '' animationToggle.innerText = 'Animation Disabled' } localStorage.setItem(ANIMATION_KEY, enableAnimation ? 'true' : 'false') } animationToggle.addEventListener('click', () => toggleAnimation(), { passive: true}) body.addEventListener('mousemove', onMouseMove, { passive: true }) body.addEventListener('mouseleave', onFocusOut, { passive: true }) toggleAnimation(enableAnimation) if (typeof window.fetch === 'undefined') { setTimeout(() => window.location.reload(), 1000) } else { const check = async () => { try { const body = await window .fetch(window.location.href) .then(r => r.text()) if (!body.includes('__NUXT_LOADING__')) { return window .location .reload() } } catch {} setTimeout(check, 1000) } check() }<\/script></body></html>`; }; const dev = defineUntypedSchema({ devServer: { /** * Whether to enable HTTPS. * @example * ```ts * export default defineNuxtConfig({ * devServer: { * https: { * key: './server.key', * cert: './server.crt' * } * } * }) * ``` * @type {boolean | { key: string; cert: string }} */ https: false, /** Dev server listening port */ port: process.env.NUXT_PORT || process.env.NITRO_PORT || process.env.PORT || 3e3, /** Dev server listening host */ host: process.env.NUXT_HOST || process.env.NITRO_HOST || process.env.HOST || void 0, /** * Listening dev server URL. * * This should not be set directly as it will always be overridden by the * dev server with the full URL (for module and internal use). */ url: "http://localhost:3000", /** * Template to show a loading screen * @type {(data: { loading?: string }) => string} */ loadingTemplate: template } }); const experimental = defineUntypedSchema({ /** * `future` is for early opting-in to new features that will become default in a future * (possibly major) version of the framework. */ future: { /** * Enable early access to Nuxt v4 features or flags. * * Setting `compatibilityVersion` to `4` changes defaults throughout your * Nuxt configuration, but you can granularly re-enable Nuxt v3 behaviour * when testing (see example). Please file issues if so, so that we can * address in Nuxt or in the ecosystem. * * @example * ```ts * export default defineNuxtConfig({ * future: { * compatibilityVersion: 4, * }, * // To re-enable _all_ Nuxt v3 behaviour, set the following options: * srcDir: '.', * dir: { * app: 'app' * }, * experimental: { * compileTemplate: true, * templateUtils: true, * relativeWatchPaths: true, * resetAsyncDataToUndefined: true, * defaults: { * useAsyncData: { * deep: true * } * } * }, * unhead: { * renderSSRHeadOptions: { * omitLineBreaks: false * } * } * }) * ``` * @type {3 | 4} */ compatibilityVersion: 3, /** * This enables early access to the experimental multi-app support. * @see [Nuxt Issue #21635](https://github.com/nuxt/nuxt/issues/21635) */ multiApp: false, /** * This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting * for frameworks like Nuxt and Vite. * * It improves type support when using modern libraries with `exports`. * * You can set it to false to use the legacy 'Node' mode, which is the default for TypeScript. * * @see [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669) */ typescriptBundlerResolution: { async $resolve(val, get) { val = val ?? await get("experimental").then((e) => e?.typescriptBundlerResolution); if (typeof val === "boolean") { return val; } const setting = await get("typescript.tsConfig.compilerOptions.moduleResolution"); if (setting) { return setting.toLowerCase() === "bundler"; } return true; } } }, /** * Some features of Nuxt are available on an opt-in basis, or can be disabled based on your needs. */ features: { /** * Inline styles when rendering HTML (currently vite only). * * You can also pass a function that receives the path of a Vue component * and returns a boolean indicating whether to inline the styles for that component. * @type {boolean | ((id?: string) => boolean)} */ inlineStyles: { async $resolve(val, get) { val = val ?? await get("experimental").then((e) => e?.inlineSSRStyles); if (val === false || await get("dev") || await get("ssr") === false || await get("builder") === "@nuxt/webpack-builder") { return false; } return val ?? true; } }, /** * Stream server logs to the client as you are developing. These logs can * be handled in the `dev:ssr-logs` hook. * * If set to `silent`, the logs will not be printed to the browser console. * @type {boolean | 'silent'} */ devLogs: { async $resolve(val, get) { if (val !== void 0) { return val; } const [isDev, isTest] = await Promise.all([get("dev"), get("test")]); return isDev && !isTest; } }, /** * Turn off rendering of Nuxt scripts and JS resource hints. * You can also disable scripts more granularly within `routeRules`. */ noScripts: { async $resolve(val, get) { return val ?? await get("experimental").then((e) => e?.noScripts) ?? false; } } }, experimental: { /** * Set to true to generate an async entry point for the Vue bundle (for module federation support). */ asyncEntry: { $resolve: (val) => val ?? false }, // TODO: Remove when nitro has support for mocking traced dependencies // https://github.com/unjs/nitro/issues/1118 /** * Externalize `vue`, `@vue/*` and `vue-router` when building. * @see [Nuxt Issue #13632](https://github.com/nuxt/nuxt/issues/13632) */ externalVue: true, /** * Tree shakes contents of client-only components from server bundle. * @see [Nuxt PR #5750](https://github.com/nuxt/framework/pull/5750) * @deprecated This option will no longer be configurable in Nuxt v4 */ treeshakeClientOnly: { async $resolve(val, get) { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4 && val === false) { console.warn("Enabling `experimental.treeshakeClientOnly` in v4 compatibility mode as it will no longer be configurable in Nuxt v4."); return true; } return val ?? true; } }, /** * Emit `app:chunkError` hook when there is an error loading vite/webpack * chunks. * * By default, Nuxt will also perform a hard reload of the new route * when a chunk fails to load when navigating to a new route. * * You can disable automatic handling by setting this to `false`, or handle * chunk errors manually by setting it to `manual`. * @see [Nuxt PR #19038](https://github.com/nuxt/nuxt/pull/19038) * @type {false | 'manual' | 'automatic'} */ emitRouteChunkError: { $resolve: (val) => { if (val === true) { return "manual"; } if (val === "reload") { return "automatic"; } return val ?? "automatic"; } }, /** * By default the route object returned by the auto-imported `useRoute()` composable * is kept in sync with the current page in view in `<NuxtPage>`. This is not true for * `vue-router`'s exported `useRoute` or for the default `$route` object available in your * Vue templates. * * By enabling this option a mixin will be injected to keep the `$route` template object * in sync with Nuxt's managed `useRoute()`. */ templateRouteInjection: true, /** * Whether to restore Nuxt app state from `sessionStorage` when reloading the page * after a chunk error or manual `reloadNuxtApp()` call. * * To avoid hydration errors, it will be applied only after the Vue app has been mounted, * meaning there may be a flicker on initial load. * * Consider carefully before enabling this as it can cause unexpected behavior, and * consider providing explicit keys to `useState` as auto-generated keys may not match * across builds. * @type {boolean} */ restoreState: false, /** Render JSON payloads with support for revivifying complex types. */ renderJsonPayloads: true, /** * Disable vue server renderer endpoint within nitro. */ noVueServer: false, /** * When this option is enabled (by default) payload of pages that are prerendered are extracted * @type {boolean | undefined} */ payloadExtraction: true, /** * Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client * if there's an error in SSR. */ clientFallback: false, /** Enable cross-origin prefetch using the Speculation Rules API. */ crossOriginPrefetch: false, /** * Enable View Transition API integration with client-side router. * @see [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) * @type {boolean | 'always'} */ viewTransition: false, /** * Write early hints when using node server. * @note nginx does not support 103 Early hints in the current version. */ writeEarlyHints: false, /** * Experimental component islands support with `<NuxtIsland>` and `.island.vue` files. * * By default it is set to 'auto', which means it will be enabled only when there are islands, * server components or server pages in your app. * @type {true | 'auto' | 'local' | 'local+remote' | Partial<{ remoteIsland: boolean, selectiveClient: boolean | 'deep' }> | false} */ componentIslands: { $resolve: (val) => { if (val === "local+remote") { return { remoteIsland: true }; } if (val === "local") { return true; } return val ?? "auto"; } }, /** * Config schema support * @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592) * @deprecated This option will no longer be configurable in Nuxt v4 */ configSchema: { async $resolve(val, get) { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4 && val === false) { console.warn("Enabling `experimental.configSchema` in v4 compatibility mode as it will no longer be configurable in Nuxt v4."); return true; } return val ?? true; } }, /** * Whether or not to add a compatibility layer for modules, plugins or user code relying on the old * `@vueuse/head` API. * * This is disabled to reduce the client-side bundle by ~0.5kb. * @deprecated This feature will be removed in Nuxt v4. */ polyfillVueUseHead: { async $resolve(val, get) { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4 && val === true) { console.warn("Disabling `experimental.polyfillVueUseHead` in v4 compatibility mode as it will no longer be configurable in Nuxt v4."); return false; } return val ?? false; } }, /** * Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. * @deprecated This feature will be removed in Nuxt v4. */ respectNoSSRHeader: { async $resolve(val, get) { const isV4 = (await get("future")).compatibilityVersion === 4; if (isV4 && val === true) { console.warn("Disabling `experimental.respectNoSSRHeader` in v4 compatibility mode as it will no longer be configurable in Nuxt v4."); return false; } return val ?? false; } }, /** Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to their layer source and root directories. */ localLayerAliases: true, /** Enable the new experimental typed router using [unplugin-vue-router](https://github.com/posva/unplugin-vue-router). */ typedPages: false, /** * Use app manifests to respect route rules on client-side. */ appManifest: true, /** * Set the time interval (in ms) to check for new builds. Disabled when `experimental.appManifest` is `false`. * * Set to `false` to disable. * @type {number | false} */ checkOutdatedBuildInterval: 1e3 * 60 * 60, /** * Set an alternative watcher that will be used as the watching service for Nuxt. * * Nuxt uses 'chokidar-granular' if your source directory is the same as your root * directory . This will ignore top-level directories (like `node_modules` and `.git`) * that are excluded from watching. * * You can set this instead to `parcel` to use `@parcel/watcher`, which may improve * performance in large projects or on Windows platforms. * * You can also set this to `chokidar` to watch all files in your source directory. * @see [chokidar](https://github.com/paulmillr/chokidar) * @see [@parcel/watcher](https://github.com/parcel-bundler/watcher) * @type {'chokidar' | 'parcel' | 'chokidar-granular'} */ watcher: { $resolve: async (val, get) => { if (val) { return val; } const [srcDir, rootDir] = await Promise.all([get("srcDir"), get("rootDir")]); if (srcDir === rootDir) { return "chokidar-granular"; } return "chokidar"; } }, /** * Enable native async context to be accessible for nested composables * @see [Nuxt PR #20918](https://github.com/nuxt/nuxt/pull/20918) */ asyncContext: false, /** * Use new experimental head optimisations: * * - Add the capo.js head plugin in order to render tags in of the head in a more performant way. * - Uses the hash hydration plugin to reduce initial hydration * * @see [Nuxt Discussion #22632](https://github.com/nuxt/nuxt/discussions/22632) */ headNext: true, /** * Allow defining `routeRules` directly within your `~/pages` directory using `defineRouteRules`. * * Rules are converted (based on the path) and applied for server requests. For example, a rule * defined in `~/pages/foo/bar.vue` will be applied to `/foo/bar` requests. A rule in `~/pages/foo/[id].vue` * will be applied to `/foo/**` requests. * * For more control, such as if you are using a custom `path` or `alias` set in the page's `definePageMeta`, you * should set `routeRules` directly within your `nuxt.config`. */ inlineRouteRules: false, /** * Allow exposing some route metadata defined in `definePageMeta` at build-time to modules (alias, name, path, redirect). * * This only works with static or strings/arrays rather than variables or conditional assignment. * * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/24770) */ scanPageMeta: true, /** * Automatically share payload _data_ between pages that are prerendered. This can result in a significant * performance improvement when prerendering sites that use `useAsyncData` or `useFetch` and fetch the same * data in different pages. * * It is particularly important when enabling this feature to make sure that any unique key of your data * is always resolvable to the same data. For example, if you are using `useAsyncData` to fetch * data related to a particular page, you should provide a key that uniquely matches that data. (`useFetch` * should do this automatically for you.) * @example * ```ts * // This would be unsafe in a dynamic page (e.g. `[slug].vue`) because the route slug makes a difference * // to the data fetched, but Nuxt can't know that because it's not reflected in the key. * const route = useRoute() * const { data } = await useAsyncData(async () => { * return await $fetch(`/api/my-page/${route.params.slug}`) * }) * // Instead, you should use a key that uniquely identifies the data fetched. * const { data } = await useAsyncData(route.params.slug, async () => { * return await $fetch(`/api/my-page/${route.params.slug}`) * }) * ``` */ sharedPrerenderData: { async $resolve(val, get) { return val ?? (await get("future")).compatibilityVersion === 4; } }, /** * Enables CookieStore support to listen for cookie updates (if supported by the browser) and refresh `useCookie` ref values. * @see [CookieStore](https://developer.mozilla.org/en-US/docs/Web/API/CookieStore) */ cookieStore: true, /** * This allows specifying the default options for core Nuxt components and composables. * * These options will likely be moved elsewhere in the future, such as into `app.config` or into the * `app/` directory. */ defaults: { /** @type {typeof import('#app/components/nuxt-link')['NuxtLinkOptions']} */ nuxtLink: { componentName: "NuxtLink", prefetch: true, prefetchOn: { visibility: true } }, /** * Options that apply to `useAsyncData` (and also therefore `useFetch`) */ useAsyncData: { /** @type {'undefined' | 'null'} */ value: { async $resolve(val, get) { return val ?? ((await get("future")).compatibilityVersion === 4 ? "undefined" : "null"); } }, /** @type {'undefined' | 'null'} */ errorValue: { async $resolve(val, get) { return val ?? ((await get("future")).compatibilityVersion === 4 ? "undefined" : "null"); } }, deep: { async $resolve(val, get) { return val ?? !((await get("future")).compatibilityVersion === 4); } } }, /** @type {Pick<typeof import('ofetch')['FetchOptions'], 'timeout' | 'retry' | 'retryDelay' | 'retryStatusCodes'>} */ useFetch: {} }, /** * Automatically polyfill Node.js imports in the client build using `unenv`. * @see [unenv](https://github.com/unjs/unenv) * * **Note:** To make globals like `Buffer` work in the browser, you need to manually inject them. * * ```ts * import { Buffer } from 'node:buffer' * * globalThis.Buffer = globalThis.Buffer || Buffer * ``` * @type {boolean} */ clientNodeCompat: false, /** * Whether to use `lodash.template` to compile Nuxt templates. * * This flag will be removed with the release of v4 and exists only for * advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). */ compileTemplate: { async $resolve(val, get) { return val ?? (await get("future")).compatibilityVersion !== 4; } }, /** * Whether to provide a legacy `templateUtils` object (with `serialize`, * `importName` and `importSources`) when compiling Nuxt templates. * * This flag will be removed with the release of v4 and exists only for * advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). */ templateUtils: { async $resolve(val, get) { return val ?? (await get("future")).compatibilityVersion !== 4; } }, /** * Whether to provide relative paths in the `builder:watch` hook. * * This flag will be removed with the release of v4 and exists only for * advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). */ relativeWatchPaths: { async $resolve(val, get) { return val ?? (await get("future")).compatibilityVersion !== 4; } }, /** * Whether `clear` and `clearNuxtData` should reset async data to its _default_ value or update * it to `null`/`undefined`. */ resetAsyncDataToUndefined: { async $resolve(val, get) { return val ?? (await get("future")).compatibilityVersion !== 4; } }, /** * Wait for a single animation frame before navigation, which gives an opportunity * for the browser to repaint, acknowledging user interaction. * * It can reduce INP when navigating on prerendered routes. */ navigationRepaint: true } }); const generate = defineUntypedSchema({ generate: { /** * The routes to generate. * * If you are using the crawler, this will be only the starting point for route generation. * This is often necessary when using dynamic routes. * * It is preferred to use `nitro.prerender.routes`. * @example * ```js * routes: ['/users/1', '/users/2', '/users/3'] * ``` * @type {string | string[]} */ routes: [], /** * This option is no longer used. Instead, use `nitro.prerender.ignore`. * @deprecated */ exclude: [] } }); const internal = defineUntypedSchema({ /** @private */ _majorVersion: 3, /** @private */ _legacyGenerate: false, /** @private */ _start: false, /** @private */ _build: false, /** @private */ _generate: false, /** @private */ _prepare: false, /** @private */ _cli: false, /** @private */ _requiredModules: {}, /** @private */ _nuxtConfigFile: void 0, /** @private */ _nuxtConfigFiles: [], /** @private */ appDir: "", /** * @private * @type {Array<{ meta: ModuleMeta; timings?: Record<string, number | undefined>; entryPath?: string }>} */ _installedModules: [], /** @private */ _modules: [] }); const nitro = defineUntypedSchema({ /** * Configuration for Nitro. * @see [Nitro configuration docs](https://nitro.unjs.io/config/) * @type {typeof import('nitropack')['NitroConfig']} */ nitro: { runtimeConfig: { $resolve: async (val, get) => { const runtimeConfig = await get("runtimeConfig"); return { ...runtimeConfig, app: { ...runtimeConfig.app, baseURL: runtimeConfig.app.baseURL.startsWith("./") ? runtimeConfig.app.baseURL.slice(1) : runtimeConfig.app.baseURL }, nitro: { envPrefix: "NUXT_", ...runtimeConfig.nitro } }; } }, routeRules: { $resolve: async (val, get) => ({ ...await get("routeRules"), ...val }) } }, /** * Global route options applied to matching server routes. * @experimental This is an experimental feature and API may change in the future. * @see [Nitro route rules documentation](https://nitro.unjs.io/config/#routerules) * @type {typeof import('nitropack')['NitroConfig']['routeRules']} */ routeRules: {}, /** * Nitro server handlers. * * Each handler accepts the following options: * * - handler: The path to the file defining the handler. * - route: The route under which the handler is available. This follows the conventions of [radix3](https://github.com/unjs/radix3.) * - method: The HTTP method of requests that should be handled. * - middleware: Specifies whether it is a middleware handler. * - lazy: Specifies whether to use lazy loading to import the handler. * * @see [`server/` directory documentation](https://nuxt.com/docs/guide/directory-structure/server) * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. * @example * ```js * serverHandlers: [ * { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' } * ] * ``` * @type {typeof import('nitropack')['NitroEventHandler'][]} */ serverHandlers: [], /** * Nitro development-only server handlers. * @see [Nitro server routes documentation](https://nitro.unjs.io/guide/routing) * @type {typeof import('nitropack')['NitroDevEventHandler'][]} */ devServerHandlers: [] }); const ensureItemIsLast = (item) => (arr) => { const index = arr.indexOf(item); if (index !== -1) { arr.splice(index, 1); arr.push(item); } return arr; }; const orderPresets = { cssnanoLast: ensureItemIsLast("cssnano"), autoprefixerLast: ensureItemIsLast("autoprefixer"), autoprefixerAndCssnanoLast(names) { return orderPresets.cssnanoLast(orderPresets.autoprefixerLast(names)); } }; const postcss = defineUntypedSchema({ postcss: { /** * A strategy for ordering PostCSS plugins. * * @type {'cssnanoLast' | 'autoprefixerLast' | 'autoprefixerAndCssnanoLast' | string[] | ((names: string[]) => string[])} */ order: { $resolve: (val) => { if (typeof val === "string") { if (!(val in orderPresets)) { throw new Error(`[nuxt] Unknown PostCSS order preset: ${val}`); } return orderPresets[val]; } return val ?? orderPresets.autoprefixerAndCssnanoLast; } }, /** * Options for configuring PostCSS plugins. * * @see [PostCSS docs](https://postcss.org/) * @type {Record<string, unknown> & { autoprefixer?: typeof import('autoprefixer').Options; cssnano?: typeof import('cssnano').Options }} */ plugins: { /** * Plugin to parse CSS and add vendor prefixes to CSS rules. * * @see [`autoprefixer`](https://github.com/postcss/autoprefixer) */ autoprefixer: {}, /** * @see [`cssnano` configuration options](https://cssnano.github.io/cssnano/docs/config-file/#configuration-options) */ cssnano: { $resolve: async (val, get) => { if (val || val === false) { return val; } if (await get("dev")) { return false; } return {}; } } } } }); const router = defineUntypedSchema({ router: { /** * Additional router options passed to `vue-router`. On top of the options for `vue-router`, * Nuxt offers additional options to customize the router (see below). * @note Only JSON serializable options should be passed by Nuxt config. * For more control, you can use `app/router.options.ts` file. * @see [Vue Router documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). * @type {typeof import('../src/types/router').RouterConfigSerializable} */ options: { /** * You can enable hash history in SPA mode. In this mode, router uses a hash character (#) before * the actual URL that is internally passed. When enabled, the * **URL is never sent to the server** and **SSR is not supported**. * @type {typeof import('../src/types/router').RouterConfigSerializable['hashMode']} * @default false */ hashMode: false, /** * Customize the scroll behavior for hash links. * @type {typeof import('../src/types/router').RouterConfigSerializable['scrollBehaviorType']} * @default 'auto' */ scrollBehaviorType: "auto" } } }); const typescript = defineUntypedSchema({ /** * Configuration for Nuxt's TypeScript integration. * */ typescript: { /** * TypeScript comes with certain checks to give you more safety and analysis of your program. * Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. * [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks) */ strict: true, /** * Which builder types to include for your project. * * By default Nuxt infers this based on your `builder` option (defaulting to 'vite') but you can either turn off * builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option. * * The 'shared' option is advised for module authors, who will want to support multiple possible builders. * @type {'vite' | 'webpack' | 'shared' | false | undefined} */ builder: { $resolve: (val) => val ?? null }, /** * Modules to generate deep aliases for within `compilerOptions.paths`. This does not yet support subpaths. * It may be necessary when using Nuxt within a pnpm monorepo with `shamefully-hoist=false`. */ hoist: { $resolve: (val) => { const defaults = [ // Nitro auto-imported/augmented dependencies "nitropack", "defu", "h3", "consola", "ofetch", // Key nuxt dependencies "@unhead/vue", "@nuxt/devtools", "vue", "@vue/runtime-core", "@vue/compiler-sfc", "vue-router", "vue-router/auto-routes", "unplugin-vue-router/client", "@nuxt/schema", "nuxt" ]; return val === false ? [] : Array.isArray(val) ? val.concat(defaults) : defaults; } }, /** * Include parent workspace in the Nuxt project. Mostly useful for themes and module authors. */ includeWorkspace: false, /** * Enable build-time type checking. * * If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. * Requires to install `typescript` and `vue-tsc` as dev dependencies. * @see [Nuxt TypeScript docs](https://nuxt.com/docs/guide/concepts/typescript) * @type {boolean | 'build'} */ typeCheck: false, /** * You can extend generated `.nuxt/tsconfig.json` using this option. * @type {0 extends 1 & VueCompilerOptions ? typeof import('pkg-types')['TSConfig'] : typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: typeof import('@vue/language-core')['VueCompilerOptions']}} */ tsConfig: {}, /** * Generate a `*.vue` shim. * * We recommend instead letting the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) * generate accurate types for your components. * * Note that you may wish to set this to `true` if you are using other libraries, such as ESLint, * that are unable to understand the type of `.vue` files. */ shim: false } }); const vite = defineUntypedSchema({ /** * Configuration that will be passed directly to Vite. * * @see [Vite configuration docs](https://vitejs.dev/config) for more information. * Please note that not all vite options are supported in Nuxt. * @type {typeof import('../src/types/config').ViteConfig & { $client?: typeof import('../src/types/config').ViteConfig, $server?: typeof import('../src/types/config').ViteConfig }} */ vite: { root: { $resolve: async (val, get) => val ?? await get("srcDir") }, mode: { $resolve: async (val, get) => val ?? (await get("dev") ? "development" : "production") }, define: { $resolve: async (val, get) => { const [isDev, isDebug] = await Promise.all([get("dev"), get("debug")]); return { "__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": isDebug, "process.dev": isDev, "import.meta.dev": isDev, "process.test": C, "import.meta.test": C, ...val }; } }, resolve: { extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"] }, publicDir: { $resolve: (val) => { if (val) { consola.warn("Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`."); } return false; } }, vue: { isProduction: { $resolve: async (val, get) => val ?? !await get("dev") }, template: { compilerOptions: { $resolve: async (val, get) => val ?? (await get("vue")).compilerOptions }, transformAssetUrls: { $resolve: async (val, get) => val ?? (await get("vue")).transformAssetUrls } }, script: { hoistStatic: { $resolve: async (val, get) => val ?? (await get("vue")).compilerOptions?.hoistStatic } }, features: { propsDestructure: { $resolve: async (val, get) => { if (val !== void 0 && val !== null) { return val; } const vueOptions = await get("vue") || {}; return Boolean(vueOptions.script?.propsDestructure ?? vueOptions.propsDestructure); } } } }, vueJsx: { $resolve: async (val, get) => { return { isCustomElement: (await get("vue")).compilerOptions?.isCustomElement, ...val }; } }, optimizeDeps: { exclude: { $resolve: async (val, get) => [ ...val || [], ...(await get("build.transpile")).filter((i) => typeof i === "string"), "vue-demi" ] } }, esbuild: { jsxFactory: "h", jsxFragment: "Fragment", tsconfigRaw: "{}" }, clearScreen: true, build: { assetsDir: { $resolve: async (val, get) => val ?? withoutLeadingSlash((await get("app")).buildAssetsDir) }, emptyOutDir: false }, server: { fs: { allow: { $resolve: async (val, get) => { const [buildDir, srcDir, rootDir, workspaceDir, modulesDir] = await Promise.all([get("buildDir"), get("srcDir"), get("rootDir"), get("workspaceDir"), get("modulesDir")]); return [.../* @__PURE__ */ new Set([ buildDir, srcDir, rootDir, workspaceDir, ...modulesDir, ...val ?? [] ])]; } } } }, cacheDir: { $resolve: async (val, get) => val ?? resolve(await get("rootDir"), "node_modules/.cache/vite") } } }); const webpack = defineUntypedSchema({ webpack: { /** * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. * * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). * @example * ```js * analyze: { * analyzerMode: 'static' * } * ``` * @type {boolean | { enabled?: boolean } & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options} */ analyze: { $resolve: async (val, get) => { const value = typeof val === "boolean" ? { enabled: val } : val; return defu(value, await get("build.analyze")); } }, /** * Enable the profiler in webpackbar. * * It is normally enabled by CLI argument `--profile`. * @see [webpackbar](https://github.com/unjs/webpackbar#profile). */ profile: process.argv.includes("--profile"), /** * Enables Common CSS Extraction. * * Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted * into separate files, usually one per component. This allows caching your CSS and * JavaScript separately. * @example * ```js * export default { * webpack: { * extractCSS: true, * // or * extractCSS: { * ignoreOrder: true * } * } * } * ``` * * If you want to extract all your CSS to a single file, there is a workaround for this. * However, note that it is not recommended to extract everything into a single file. * Extracting into multiple CSS files is better for caching and preload isolation. It * can also improve page performance by downloading and resolving only those resources * that are needed. * @example * ```js * export default { * webpack: { * extractCSS: true, * optimization: { * splitChunks: { * cacheGroups: { * styles: { * name: 'styles', * test: /\.(css|vue)$/, * chunks: 'all', * enforce: true * } * } * } * } * } * } * ``` * @type {boolean | typeof import('mini-css-extract-plugin').PluginOptions} */ extractCSS: true, /** * Enables CSS source map support (defaults to `true` in development). */ cssSourceMap: { $resolve: async (val, get) => val ?? await get("dev") }, /** * The polyfill library to load to provide URL and URLSearchParams. * * Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)). */ serverURLPolyfill: "url", /** * Customize bundle filenames. * * To understand a bit more about the use of manifests, take a look at [webpack documentation](https://webpack.js.org/guides/code-splitting/). * @note Be careful when using non-hashed based filenames in production * as most browsers will cache the asset and not detect the changes on first load. * * This example changes fancy chunk names to numerical ids: * @example * ```js * filenames: { * chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js') * } * ``` * @type { * Record< * string, * string | * (( * ctx: { * nuxt: import('../src/types/nuxt').Nuxt, * options: import('../src/types/nuxt').Nuxt['options'], * name: string, * isDev: boolean, * isServer: boolean, * isClient: boolean, * alias: { [index: string]: string | false | string[] }, * transpile: RegExp[] * }) => string) * > * } */ filenames: { app: ({ isDev }) => isDev ? "[name].js" : "[contenthash:7].js", chunk: ({ isDev }) => isDev ? "[name].js" : "[contenthash:7].js", css: ({ isDev }) => isDev ? "[name].css" : "css/[contenthash:7].css", img: ({ isDev }) => isDev ? "[path][name].[ext]" : "img/[name].[contenthash:7].[ext]", font: ({ isDev }) => isDev ? "[path][name].[ext]" : "fonts/[name].[contenthash:7].[ext]", video: ({ isDev }) => isDev ? "[path][name].[ext]" : "videos/[name].[contenthash:7].[ext]" }, /** * Customize the options of Nuxt's integrated webpack loaders. */ loaders: { $resolve: async (val, get) => { const loaders = val && typeof val === "object" ? val : {}; const styleLoaders = [ "css", "cssModules", "less", "sass", "scss", "stylus", "vueStyle" ]; for (const name of styleLoaders) { const loader = loaders[name]; if (loader && loader.sourceMap === void 0) { loader.sourceMap = Boolean(await get("build.cssSourceMap")); } } return loaders; }, /** * @see [esbuild loader](https://github.com/esbuild-kit/esbuild-loader) * @type {Omit<typeof import('esbuild-loader')['LoaderOptions'], 'loader'>} */ esbuild: { jsxFactory: "h", jsxFragment: "Fragment", tsconfigRaw: "{}" }, /** * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @default * ```ts * { esModule: false } * ``` */ file: { esModule: false }, /** * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @default * ```ts * { esModule: false, limit: 1000 } * ``` */ fontUrl: { esModule: false, limit: 1e3 }, /** * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @default * ```ts * { esModule: false, limit: 1000 } * ``` */ imgUrl: { esModule: false, limit: 1e3 }, /** * @see [`pug` options](https://pugjs.org/api/reference.html#options) * @type {typeof import('pug')['Options']} */ pugPlain: {}, /** * See [vue-loader](https://github.com/vuejs/vue-loader) for available options. * @type {Partial<typeof import('vue-loader')['VueLoaderOptions']>} */ vue: { transformAssetUrls: { $resolve: async (val, get) => val ?? await get("vue.transformAssetUrls") }, compilerOptions: { $resolve: async (val, get) => val ?? await get("vue.compilerOptions") }, propsDestructure: { $resolve: async (val, get) => Boolean(val ?? await get("vue.propsDestructure")) } }, css: { importLoaders: 0, url: { filter: (url, _resourcePath) => url[0] !== "/" }, esModule: false }, cssModules: { importLoaders: 0, url: { filter: (url, _resourcePath) => url[0] !== "/" }, esModule: false, modules: { localIdentName: "[local]_[hash:base64:5]" } }, /** * @see [`less-loader` Options](https://github.com/webpack-contrib/less-loader#options) */ less: {}, /** * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options) * @type {typeof import('sass-loader')['Options']} * @default * ```ts * { * sassOptions: { * indentedSyntax: true * } * } * ``` */ sass: { sassOptions: { indentedSyntax: true } }, /** * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options) * @type {typeof import('sass-loader')['Options']} */ scss: {}, /** * @see [`stylus-loader` Options](https://github.com/webpack-contrib/stylus-loader#options) */ stylus: {}, vueStyle: {} }, /** * Add webpack plugins. * @example * ```js * import webpack from 'webpack' * import { version } from './package.json' * // ... * plugins: [ * new webpack.DefinePlugin({ * 'process.VERSION': version * }) * ] * ``` */ plugins: [], /** * Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle. */ aggressiveCodeRemoval: false, /** * OptimizeCSSAssets plugin options. * * Defaults to true when `extractCSS` is enabled. * @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin). * @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions<any>} */ optimizeCSS: { $resolve: async (val, get) => val ?? (await get("build.extractCSS") ? {} : false) }, /** * Configure [webpack optimization](https://webpack.js.org/configuration/optimization/). * @type {false | typeof import('webpack').Configuration['optimization']} */ optimization: { runtimeChunk: "single", /** Set minimize to `false` to disable all minimizers. (It is disabled in development by default). */ minimize: { $resolve: async (val, get) => val ?? !await get("dev") }, /** You can set minimizer to a customized array of plugins. */ minimizer: void 0, splitChunks: { chunks: "all", automaticNameDelimiter: "/", cacheGroups: {} } }, /** * Customize PostCSS Loader. * same options as [`postcss-loader` options](https://github.com/webpack-contrib/postcss-loader#options) * @type {{ execute?: boolean, postcssOptions: typeof import('postcss').ProcessOptions, sourceMap?: boolean, implementation?: any }} */ postcss: { postcssOptions: { config: { $resolve: async (val, get) => val ?? await get("postcss.config") }, plugins: { $resolve: async (val, get) => val ?? await get("postcss.plugins") } } }, /** * See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options. * @type {typeof import('webpack-dev-middleware').Options<typeof import('http').IncomingMessage, typeof import('http').ServerResponse>} */ devMiddleware: { stats: "none" }, /** * See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. * @type {typeof import('webpack-hot-middleware').MiddlewareOptions & { client?: typeof import('webpack-hot-middleware').ClientOptions }} */ hotMiddleware: {}, /** * Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin). */ friendlyErrors: true, /** * Filters to hide build warnings. * @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>} */ warningIgnoreFilters: [], /** * Configure [webpack experiments](https://webpack.js.org/configuration/experiments/) * @type {false | typeof import('webpack').Configuration['experiments']} */ experiments: {} } }); const index = { ...adhoc, ...app, ...build, ...common, ...dev, ...experimental, ...generate, ...internal, ...nitro, ...postcss, ...router, ...typescript, ...vite, ...webpack }; const nuxtCtx = getContext("nuxt"); function tryUseNuxt() { return nuxtCtx.tryUse(); } /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Built-in value references. */ var Symbol$1 = root.Symbol; /** Used for built-in method references. */ var objectProto$b = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$9 = objectProto$b.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString$1 = objectProto$b.toString; /** Built-in value references. */ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString$1.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } /** Used for built-in method references. */ var objectProto$a = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto$a.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; symbolProto ? symbolProto.toString : undefined; /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag$1 = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag; } /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** Used for built-in method references. */ var funcProto$2 = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$2 = funcProto$2.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString$2.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto$1 = Function.prototype, objectProto$9 = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$1 = funcProto$1.toString; /** Used to check objects for own properties. */ var hasOwnProperty$8 = objectProto$9.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER$1 = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER$1 : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** Used for built-in method references. */ var objectProto$8 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$7 = objectProto$8.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** Used for built-in method references. */ var objectProto$7 = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7; return value === proto; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** `Object#toString` result references. */ var argsTag$1 = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag$1; } /** Used for built-in method references. */ var objectProto$6 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$6 = objectProto$6.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto$6.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } /** Detect free variable `exports`. */ var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; /** Built-in value references. */ var Buffer = moduleExports$1 ? root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag$1 = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag$1 = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** Used for built-in method references. */ var objectProto$5 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$5 = objectProto$5.hasOwnProperty; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** Used for built-in method references. */ var objectProto$3 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$3 = objectProto$3.hasOwnProperty; /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) { result.push(key); } } return result; } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto$2 = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty$2 = objectProto$2.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** `Object#toString` result references. */ var domExcTag = '[object DOMException]', errorTag = '[object Error]'; /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Attempts to invoke `func`, returning either the result or the caught error * object. Any additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * * // Avoid throwing errors for invalid selectors. * var elements = _.attempt(function(selector) { * return document.querySelectorAll(selector); * }, '>_>'); * * if (_.isError(elements)) { * elements = []; * } */ baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { return isError(e) ? e : new Error(e); } }); jiti(process.cwd(), { interopDefault: true, esmResolve: true }); function getNodeModulesPaths(paths) { return [].concat( global.__NUXT_PREPATHS__, paths || [], process.cwd(), global.__NUXT_PATHS__ ).filter(Boolean); } async function tryResolveModule(id, url = import.meta.url) { try { return await resolvePath$1(id, { url }); } catch { } } async function resolvePath(path, opts = {}) { const _path = path; path = normalize(path); if (isAbsolute(path)) { if (opts?.virtual && existsInVFS(path)) { return path; } if (existsSync(path) && !await isDirectory(path)) { return path; } } const nuxt = tryUseNuxt(); const cwd = opts.cwd || (nuxt ? nuxt.options.rootDir : process.cwd()); const extensions = opts.extensions || (nuxt ? nuxt.options.extensions : [".ts", ".mjs", ".cjs", ".json"]); const modulesDir = nuxt ? nuxt.options.modulesDir : []; path = resolveAlias(path); if (!isAbsolute(path)) { path = resolve(cwd, path); } if (opts?.virtual && existsInVFS(path, nuxt)) { return path; } let _isDir = false; if (existsSync(path)) { _isDir = await isDirectory(path); if (!_isDir) { return path; } } for (const ext of extensions) { const pathWithExt = path + ext; if (opts?.virtual && existsInVFS(pathWithExt, nuxt)) { return pathWithExt; } if (existsSync(pathWithExt)) { return pathWithExt; } const pathWithIndex = join(path, "index" + ext); if (opts?.virtual && existsInVFS(pathWithIndex, nuxt)) { return pathWithIndex; } if (_isDir && existsSync(pathWithIndex)) { return pathWithIndex; } } const resolveModulePath = await resolvePath$1(_path, { url: [cwd, ...modulesDir] }).catch(() => null); if (resolveModulePath) { return resolveModulePath; } return opts.fallbackToOriginal ? _path : path; } function resolveAlias(path, alias) { if (!alias) { alias = tryUseNuxt()?.options.alias || {}; } return resolveAlias$1(path, alias); } function createResolver(base) { if (!base) { throw new Error("`base` argument is missing for createResolver(base)!"); } base = base.toString(); if (base.startsWith("file://")) { base = dirname(fileURLToPath(base)); } return { resolve: (...path) => resolve(base, ...path), resolvePath: (path, opts) => resolvePath(path, { cwd: base, ...opts }) }; } async function resolveNuxtModule(base, paths) { const resolved = []; const resolver = createResolver(base); for (const path of paths) { if (path.startsWith(base)) { resolved.push(path.split("/index.ts")[0]); } else { const resolvedPath = await resolver.resolvePath(path); resolved.push(resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length)); } } return resolved; } async function isDirectory(path) { return (await promises.lstat(path)).isDirectory(); } function existsInVFS(path, nuxt = tryUseNuxt()) { if (!nuxt) { return false; } if (path in nuxt.vfs) { return true; } const templates = nuxt.apps.default?.templates ?? nuxt.options.build.templates; return templates.some((template) => template.dst === path); } function getDirectory(p) { try { return isAbsolute(p) && lstatSync(p).isFile() ? dirname(p) : p; } catch { } return p; } const layerSchemaKeys = ["future", "srcDir", "rootDir", "serverDir", "dir"]; const layerSchema = /* @__PURE__ */ Object.create(null); for (const key of layerSchemaKeys) { if (key in index) { layerSchema[key] = index[key]; } } async function _generateTypes(nuxt) { const rootDirWithSlash = withTrailingSlash(nuxt.options.rootDir); const relativeRootDir = relativeWithDot(nuxt.options.buildDir, nuxt.options.rootDir); const include = /* @__PURE__ */ new Set([ "./nuxt.d.ts", join(relativeRootDir, ".config/nuxt.*"), join(relativeRootDir, "**/*") ]); if (nuxt.options.srcDir !== nuxt.options.rootDir) { include.add(join(relative(nuxt.options.buildDir, nuxt.options.srcDir), "**/*")); } if (nuxt.options.typescript.includeWorkspace && nuxt.options.workspaceDir !== nuxt.options.rootDir) { include.add(join(relative(nuxt.options.buildDir, nuxt.options.workspaceDir), "**/*")); } for (const layer of nuxt.options._layers) { const srcOrCwd = layer.config.srcDir ?? layer.cwd; if (!srcOrCwd.startsWith(rootDirWithSlash) || srcOrCwd.includes("node_modules")) { include.add(join(relative(nuxt.options.buildDir, srcOrCwd), "**/*")); } } const exclude = /* @__PURE__ */ new Set([ // nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186 relativeWithDot(nuxt.options.buildDir, resolve(nuxt.options.rootDir, "dist")) ]); for (const dir of nuxt.options.modulesDir) { exclude.add(relativeWithDot(nuxt.options.buildDir, dir)); } const moduleEntryPaths = []; for (const m of nuxt.options._installedModules) { if (m.entryPath) { moduleEntryPaths.push(getDirectory(m.entryPath)); } } const modulePaths = await resolveNuxtModule(rootDirWithSlash, moduleEntryPaths); for (const path of modulePaths) { const relative2 = relativeWithDot(nuxt.options.buildDir, path); include.add(join(relative2, "runtime")); exclude.add(join(relative2, "runtime/server")); include.add(join(relative2, "dist/runtime")); exclude.add(join(relative2, "dist/runtime/server")); } const isV4 = nuxt.options.future?.compatibilityVersion === 4; const hasTypescriptVersionWithModulePreserve = await readPackageJSON("typescript", { url: nuxt.options.modulesDir }).then((r) => r?.version && semver.gte(r.version, "5.4.0")).catch(() => isV4); const tsConfig = defu(nuxt.options.typescript?.tsConfig, { compilerOptions: { /* Base options: */ esModuleInterop: true, skipLibCheck: true, target: "ESNext", allowJs: true, resolveJsonModule: true, moduleDetection: "force", isolatedModules: true, verbatimModuleSyntax: true, /* Strictness */ strict: nuxt.options.typescript?.strict ?? true, noUncheckedIndexedAccess: isV4, forceConsistentCasingInFileNames: true, noImplicitOverride: true, /* If NOT transpiling with TypeScript: */ module: hasTypescriptVersionWithModulePreserve ? "preserve" : "ESNext", noEmit: true, /* If your code runs in the DOM: */ lib: [ "ESNext", "dom", "dom.iterable", "webworker" ], /* JSX support for Vue */ jsx: "preserve", jsxImportSource: "vue", /* remove auto-scanning for types */ types: [], /* add paths object for filling-in later */ paths: {}, /* Possibly consider removing the following in future */ moduleResolution: nuxt.options.future?.typescriptBundlerResolution || nuxt.options.experimental?.typescriptBundlerResolution ? "Bundler" : "Node", /* implied by module: preserve */ useDefineForClassFields: true, /* implied by target: es2022+ */ noImplicitThis: true, /* enabled with `strict` */ allowSyntheticDefaultImports: true }, include: [...include], exclude: [...exclude] }); const aliases = { ...nuxt.options.alias, "#build": nuxt.options.buildDir }; const excludedAlias = [/^@vue\/.*$/]; const basePath = tsConfig.compilerOptions.baseUrl ? resolve(nuxt.options.buildDir, tsConfig.compilerOptions.baseUrl) : nuxt.options.buildDir; tsConfig.compilerOptions = tsConfig.compilerOptions || {}; tsConfig.include = tsConfig.include || []; for (const alias in aliases) { if (excludedAlias.some((re) => re.test(alias))) { continue; } let absolutePath = resolve(basePath, aliases[alias]); let stats = await promises.stat(absolutePath).catch( () => null /* file does not exist */ ); if (!stats) { const resolvedModule = await tryResolveModule(aliases[alias], nuxt.options.modulesDir); if (resolvedModule) { absolutePath = resolvedModule; stats = await promises.stat(resolvedModule).catch(() => null); } } const relativePath = relativeWithDot(nuxt.options.buildDir, absolutePath); if (stats?.isDirectory()) { tsConfig.compilerOptions.paths[alias] = [relativePath]; tsConfig.compilerOptions.paths[`${alias}/*`] = [`${relativePath}/*`]; if (!absolutePath.startsWith(rootDirWithSlash)) { tsConfig.include.push(relativePath); } } else { const path = stats?.isFile() ? relativePath.replace(/\b\.\w+$/g, "") : aliases[alias]; tsConfig.compilerOptions.paths[alias] = [path]; if (!absolutePath.startsWith(rootDirWithSlash)) { tsConfig.include.push(path); } } } const references = []; await Promise.all([...nuxt.options.modules, ...nuxt.options._modules].map(async (id) => { if (typeof id !== "string") { return; } const pkg = await readPackageJSON(id, { url: getNodeModulesPaths(nuxt.options.modulesDir) }).catch(() => null); references.push({ types: pkg?.name || id }); })); const declarations = []; await nuxt.callHook("prepare:types", { references, declarations, tsConfig }); for (const alias in tsConfig.compilerOptions.paths) { const paths = tsConfig.compilerOptions.paths[alias]; tsConfig.compilerOptions.paths[alias] = await Promise.all(paths.map(async (path) => { if (!isAbsolute(path)) { return path; } const stats = await promises.stat(path).catch( () => null /* file does not exist */ ); return relativeWithDot(nuxt.options.buildDir, stats?.isFile() ? path.replace(/\b\.\w+$/g, "") : path); })); } tsConfig.include = [...new Set(tsConfig.include.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))]; tsConfig.exclude = [...new Set(tsConfig.exclude.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))]; const declaration = [ ...references.map((ref) => { if ("path" in ref && isAbsolute(ref.path)) { ref.path = relative(nuxt.options.buildDir, ref.path); } return `/// <reference ${renderAttrs(ref)} />`; }), ...declarations, "", "export {}", "" ].join("\n"); return { declaration, tsConfig }; } async function writeTypes(nuxt) { const { tsConfig, declaration } = await _generateTypes(nuxt); async function writeFile() { const GeneratedBy = "// Generated by nuxi"; const tsConfigPath = resolve(nuxt.options.buildDir, "tsconfig.json"); await promises.mkdir(nuxt.options.buildDir, { recursive: true }); await promises.writeFile(tsConfigPath, GeneratedBy + "\n" + JSON.stringify(tsConfig, null, 2)); const declarationPath = resolve(nuxt.options.buildDir, "nuxt.d.ts"); await promises.writeFile(declarationPath, GeneratedBy + "\n" + declaration); } nuxt.hook("builder:prepared", writeFile); await writeFile(); } function renderAttrs(obj) { const attrs = []; for (const key in obj) { attrs.push(renderAttr(key, obj[key])); } return attrs.join(" "); } function renderAttr(key, value) { return value ? `${key}="${value}"` : ""; } function relativeWithDot(from, to) { return relative(from, to).replace(/^([^.])/, "./$1") || "."; } const loadKit = async (rootDir) => { try { const localKit = await tryResolveModule$1("@nuxt/kit", rootDir); const rootURL = localKit ? rootDir : await tryResolveNuxt() || rootDir; let kit = await importModule( "@nuxt/kit", rootURL ); if (!kit.writeTypes) { kit = { ...kit, writeTypes: writeTypes }; } return kit; } catch (e) { if (e.toString().includes("Cannot find module '@nuxt/kit'")) { throw new Error( "nuxi requires `@nuxt/kit` to be installed in your project. Try installing `nuxt` v3 or `@nuxt/bridge` first." ); } throw e; } }; async function tryResolveNuxt() { for (const pkg of ["nuxt-nightly", "nuxt3", "nuxt", "nuxt-edge"]) { const path = await tryResolveModule$1(pkg); if (path) { return path; } } return null; } export { loadKit as l, writeTypes as w };
Coded With 💗 by
0x6ick Mod By V1rus_Alfa