1307 lines
71 KiB
JavaScript
1307 lines
71 KiB
JavaScript
|
|
import process from "node:process";
|
||
|
|
import { defu } from "defu";
|
||
|
|
import { dirname, join, relative, resolve } from "pathe";
|
||
|
|
import { createConsoleReporter, defineDiagnostics } from "nostics";
|
||
|
|
import { existsSync } from "node:fs";
|
||
|
|
import { readFile, readdir } from "node:fs/promises";
|
||
|
|
import { randomUUID } from "node:crypto";
|
||
|
|
import { isDebug, isDevelopment, isTest } from "std-env";
|
||
|
|
import { escapeHtml } from "@vue/shared";
|
||
|
|
// src/utils/definition.ts
|
||
|
|
function defineResolvers(config) {
|
||
|
|
return config;
|
||
|
|
}
|
||
|
|
// src/config/adhoc.ts
|
||
|
|
var adhoc_default = defineResolvers({
|
||
|
|
components: { $resolve: (val) => {
|
||
|
|
if (Array.isArray(val)) return { dirs: val };
|
||
|
|
if (val === false) return { dirs: [] };
|
||
|
|
return {
|
||
|
|
dirs: [{
|
||
|
|
path: "~/components/global",
|
||
|
|
global: true
|
||
|
|
}, "~/components"],
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
imports: {
|
||
|
|
global: false,
|
||
|
|
scan: true,
|
||
|
|
dirs: []
|
||
|
|
},
|
||
|
|
pages: void 0,
|
||
|
|
telemetry: void 0,
|
||
|
|
devtools: {}
|
||
|
|
});
|
||
|
|
// src/diagnostics.ts
|
||
|
|
/**
|
||
|
|
* B5xxx (schema-resolved configuration)
|
||
|
|
* Diagnostics raised while resolving `nuxt.config` values against the schema.
|
||
|
|
* Codes continue the configuration (B5xxx) range defined in `@nuxt/kit`, which
|
||
|
|
* schema cannot import without creating a dependency cycle.
|
||
|
|
*/
|
||
|
|
const docsBase = (code) => `https://nuxt.com/docs/4.x/errors/${code.replace("NUXT_", "").toLowerCase()}`;
|
||
|
|
const schemaDiagnostics = /* #__PURE__ */ defineDiagnostics({
|
||
|
|
docsBase,
|
||
|
|
reporters: [/* @__PURE__ */ createConsoleReporter()],
|
||
|
|
codes: {
|
||
|
|
NUXT_B5012: {
|
||
|
|
why: (p) => `Invalid \`logLevel\` option: \`${p.value}\`.`,
|
||
|
|
fix: "Use one of `silent`, `info`, or `verbose`.",
|
||
|
|
docs: false
|
||
|
|
},
|
||
|
|
NUXT_B5013: {
|
||
|
|
why: "`unhead.legacy` is ignored when `future.compatibilityVersion` >= 5.",
|
||
|
|
fix: "Remove deprecated head patterns (`hid`, `vmid`, `children`, `body: true`, `renderPriority`) and resolve promise values before passing them to `useHead`.",
|
||
|
|
docs: false
|
||
|
|
},
|
||
|
|
NUXT_B5014: {
|
||
|
|
why: "Directly configuring the `vite.publicDir` option is not supported.",
|
||
|
|
fix: "Set `dir.public` instead. You can read more in `https://nuxt.com/docs/4.x/api/nuxt-config#public`.",
|
||
|
|
docs: false
|
||
|
|
},
|
||
|
|
NUXT_B5015: {
|
||
|
|
why: (p) => `Unknown PostCSS order preset: \`${p.preset}\`.`,
|
||
|
|
fix: "Use a known preset name, or pass a function to `postcss.order`.",
|
||
|
|
docs: false
|
||
|
|
},
|
||
|
|
NUXT_B5020: {
|
||
|
|
why: (p) => `\`experimental.prerenderErrorPages\` was passed \`${p.status}\`, which is not a client or server error status code.`,
|
||
|
|
fix: "Pass whole status codes between 400 and 599, such as `[404, 500]`. `/200.html` and `/index.html` are SPA fallbacks and cannot be generated as error pages.",
|
||
|
|
docs: false
|
||
|
|
},
|
||
|
|
NUXT_B5027: {
|
||
|
|
why: "`experimental.nitroViteEnvironment` is only compatible with `@nuxt/vite-builder`, so it has been disabled.",
|
||
|
|
fix: "Set `builder: \"vite\"` in your `nuxt.config`, or remove the option.",
|
||
|
|
docs: false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
// src/config/app.ts
|
||
|
|
var app_default = defineResolvers({
|
||
|
|
vue: {
|
||
|
|
transformAssetUrls: {
|
||
|
|
video: ["src", "poster"],
|
||
|
|
source: ["src"],
|
||
|
|
img: ["src"],
|
||
|
|
image: ["xlink:href", "href"],
|
||
|
|
use: ["xlink:href", "href"]
|
||
|
|
},
|
||
|
|
compilerOptions: {},
|
||
|
|
runtimeCompiler: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
optionsApi: { async $resolve(val, get) {
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
return await get("future.compatibilityVersion") < 5;
|
||
|
|
} },
|
||
|
|
/**
|
||
|
|
* Enable experimental support for Vue Vapor Mode (requires Vue 3.6+).
|
||
|
|
*
|
||
|
|
* This installs Vue's `vaporInteropPlugin` so that vapor components (SFCs using
|
||
|
|
* `<script setup vapor>` or `<template vapor>`) can be used alongside regular
|
||
|
|
* VDOM components.
|
||
|
|
* @see [Vue Vapor Mode release notes](https://github.com/vuejs/core/releases/tag/v3.6.0-rc.1)
|
||
|
|
*/
|
||
|
|
vapor: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
propsDestructure: true,
|
||
|
|
config: {}
|
||
|
|
},
|
||
|
|
app: {
|
||
|
|
baseURL: { $resolve: (val) => {
|
||
|
|
if (typeof val === "string") return val;
|
||
|
|
return process.env.NUXT_APP_BASE_URL || "/";
|
||
|
|
} },
|
||
|
|
buildAssetsDir: { $resolve: (val) => {
|
||
|
|
return (typeof val === "string" ? val : process.env.NUXT_APP_BUILD_ASSETS_DIR || "/_nuxt/").replace(/^\/?/, "/").replace(/\/?$/, "/");
|
||
|
|
} },
|
||
|
|
cdnURL: { $resolve: async (val, get) => {
|
||
|
|
if (await get("dev")) return "";
|
||
|
|
return process.env.NUXT_APP_CDN_URL || (typeof val === "string" ? val : "");
|
||
|
|
} },
|
||
|
|
head: { $resolve: (_val) => {
|
||
|
|
var _resolved$meta$find, _resolved$meta$find2;
|
||
|
|
const resolved = defu(_val && typeof _val === "object" ? _val : {}, {
|
||
|
|
meta: [],
|
||
|
|
link: [],
|
||
|
|
style: [],
|
||
|
|
script: [],
|
||
|
|
noscript: []
|
||
|
|
});
|
||
|
|
if (!((_resolved$meta$find = resolved.meta.find((m) => m === null || m === void 0 ? void 0 : m.charset)) === null || _resolved$meta$find === void 0 ? void 0 : _resolved$meta$find.charset)) resolved.meta.unshift({ charset: resolved.charset || "utf-8" });
|
||
|
|
if (!((_resolved$meta$find2 = resolved.meta.find((m) => (m === null || m === void 0 ? void 0 : m.name) === "viewport")) === null || _resolved$meta$find2 === void 0 ? void 0 : _resolved$meta$find2.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;
|
||
|
|
} },
|
||
|
|
layoutTransition: false,
|
||
|
|
pageTransition: false,
|
||
|
|
viewTransition: { $resolve: async (val, get) => {
|
||
|
|
const isEnabled = val === "always" || typeof val === "boolean";
|
||
|
|
const hasEnabled = val && typeof val === "object" && "enabled" in val;
|
||
|
|
const hasTypes = val && typeof val === "object" && "types" in val;
|
||
|
|
const appOptions = {
|
||
|
|
enabled: isEnabled ? val : hasEnabled ? val.enabled : void 0,
|
||
|
|
types: hasTypes ? val.types : void 0
|
||
|
|
};
|
||
|
|
if (appOptions.enabled !== void 0 && appOptions.types !== void 0) return appOptions;
|
||
|
|
const _configOptions = await get("experimental").then((e) => e.viewTransition) ?? { enabled: false };
|
||
|
|
const configOptions = typeof _configOptions === "object" ? _configOptions : { enabled: _configOptions };
|
||
|
|
return {
|
||
|
|
enabled: appOptions.enabled ?? configOptions.enabled,
|
||
|
|
types: appOptions.types ?? configOptions.types
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
keepalive: false,
|
||
|
|
rootId: { $resolve: (val) => val === false ? false : val && typeof val === "string" ? val : "__nuxt" },
|
||
|
|
rootTag: { $resolve: (val) => val && typeof val === "string" ? val : "div" },
|
||
|
|
rootAttrs: { $resolve: async (val, get) => {
|
||
|
|
const rootId = await get("app.rootId");
|
||
|
|
return {
|
||
|
|
id: rootId === false ? void 0 : rootId || "__nuxt",
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
teleportTag: { $resolve: (val) => val && typeof val === "string" ? val : "div" },
|
||
|
|
teleportId: { $resolve: (val) => val === false ? false : val && typeof val === "string" ? val : "teleports" },
|
||
|
|
teleportAttrs: { $resolve: async (val, get) => {
|
||
|
|
const teleportId = await get("app.teleportId");
|
||
|
|
return {
|
||
|
|
id: teleportId === false ? void 0 : teleportId || "teleports",
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
spaLoaderTag: { $resolve: (val) => val && typeof val === "string" ? val : "div" },
|
||
|
|
spaLoaderAttrs: { id: "__nuxt-loader" }
|
||
|
|
},
|
||
|
|
spaLoadingTemplate: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string") return resolve(await get("srcDir"), val);
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
return null;
|
||
|
|
} },
|
||
|
|
plugins: [],
|
||
|
|
css: { $resolve: (val) => {
|
||
|
|
if (!Array.isArray(val)) return [];
|
||
|
|
const css = [];
|
||
|
|
for (const item of val) if (typeof item === "string") css.push(item);
|
||
|
|
return css;
|
||
|
|
} },
|
||
|
|
unhead: {
|
||
|
|
legacy: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val !== "boolean") return false;
|
||
|
|
if (await get("future.compatibilityVersion") >= 5) {
|
||
|
|
if (val) schemaDiagnostics.NUXT_B5013();
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
return val;
|
||
|
|
} },
|
||
|
|
vite: {},
|
||
|
|
renderSSRHeadOptions: { $resolve: (val) => ({
|
||
|
|
omitLineBreaks: true,
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
}) }
|
||
|
|
}
|
||
|
|
});
|
||
|
|
// src/config/build.ts
|
||
|
|
var build_default = defineResolvers({
|
||
|
|
builder: { $resolve: (val) => {
|
||
|
|
if (val && typeof val === "object" && "bundle" in val) return val;
|
||
|
|
const map = {
|
||
|
|
rspack: "@nuxt/rspack-builder",
|
||
|
|
vite: "@nuxt/vite-builder",
|
||
|
|
webpack: "@nuxt/webpack-builder"
|
||
|
|
};
|
||
|
|
if (typeof val === "string" && val in map) return map[val];
|
||
|
|
return map.vite;
|
||
|
|
} },
|
||
|
|
sourcemap: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "boolean") return {
|
||
|
|
server: val,
|
||
|
|
client: val
|
||
|
|
};
|
||
|
|
return {
|
||
|
|
server: true,
|
||
|
|
client: await get("dev"),
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
logLevel: { $resolve: async (val, get) => {
|
||
|
|
if (val && typeof val === "string" && ![
|
||
|
|
"silent",
|
||
|
|
"info",
|
||
|
|
"verbose"
|
||
|
|
].includes(val)) schemaDiagnostics.NUXT_B5012({ value: val });
|
||
|
|
return val && typeof val === "string" ? val : await get("test") ? "silent" : "info";
|
||
|
|
} },
|
||
|
|
build: {
|
||
|
|
transpile: { $resolve: (val) => {
|
||
|
|
const transpile = [];
|
||
|
|
if (Array.isArray(val)) for (const pattern of val) {
|
||
|
|
if (!pattern) continue;
|
||
|
|
if (typeof pattern === "string" || typeof pattern === "function" || pattern instanceof RegExp) transpile.push(pattern);
|
||
|
|
}
|
||
|
|
return transpile;
|
||
|
|
} },
|
||
|
|
templates: [],
|
||
|
|
analyze: { $resolve: async (val, get) => {
|
||
|
|
const [rootDir, analyzeDir] = await Promise.all([get("rootDir"), get("analyzeDir")]);
|
||
|
|
return {
|
||
|
|
template: "treemap",
|
||
|
|
projectRoot: rootDir,
|
||
|
|
filename: join(analyzeDir, "{name}.html"),
|
||
|
|
...typeof val === "boolean" ? { enabled: val } : typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} }
|
||
|
|
},
|
||
|
|
optimization: {
|
||
|
|
keyedComposables: { $resolve: (val) => [
|
||
|
|
{
|
||
|
|
name: "callOnce",
|
||
|
|
argumentLength: 3,
|
||
|
|
source: "#app/composables/once"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "defineNuxtComponent",
|
||
|
|
argumentLength: 2,
|
||
|
|
source: "#app/composables/component"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "useState",
|
||
|
|
argumentLength: 2,
|
||
|
|
source: "#app/composables/state"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "useFetch",
|
||
|
|
argumentLength: 3,
|
||
|
|
source: "#app/composables/fetch"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "useAsyncData",
|
||
|
|
argumentLength: 3,
|
||
|
|
source: "#app/composables/asyncData"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "useLazyAsyncData",
|
||
|
|
argumentLength: 3,
|
||
|
|
source: "#app/composables/asyncData"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "useLazyFetch",
|
||
|
|
argumentLength: 3,
|
||
|
|
source: "#app/composables/fetch"
|
||
|
|
},
|
||
|
|
...Array.isArray(val) ? val : []
|
||
|
|
].filter(Boolean) },
|
||
|
|
keyedComposableFactories: { $resolve: (val) => [
|
||
|
|
{
|
||
|
|
name: "createUseFetch",
|
||
|
|
source: "#app/composables/fetch",
|
||
|
|
argumentLength: 3
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "createUseAsyncData",
|
||
|
|
source: "#app/composables/asyncData",
|
||
|
|
argumentLength: 3
|
||
|
|
},
|
||
|
|
...Array.isArray(val) ? val : []
|
||
|
|
].filter(Boolean) },
|
||
|
|
treeShake: { composables: {
|
||
|
|
server: { $resolve: async (val, get) => defu(typeof val === "object" ? val || {} : {}, await get("dev") ? {} : {
|
||
|
|
"vue": [
|
||
|
|
"onMounted",
|
||
|
|
"onUpdated",
|
||
|
|
"onUnmounted",
|
||
|
|
"onBeforeMount",
|
||
|
|
"onBeforeUpdate",
|
||
|
|
"onBeforeUnmount",
|
||
|
|
"onRenderTracked",
|
||
|
|
"onRenderTriggered",
|
||
|
|
"onActivated",
|
||
|
|
"onDeactivated"
|
||
|
|
],
|
||
|
|
"#app": ["definePayloadReviver", "definePageMeta"]
|
||
|
|
}) },
|
||
|
|
client: { $resolve: async (val, get) => defu(typeof val === "object" ? val || {} : {}, await get("dev") ? {} : {
|
||
|
|
"vue": [
|
||
|
|
"onRenderTracked",
|
||
|
|
"onRenderTriggered",
|
||
|
|
"onServerPrefetch"
|
||
|
|
],
|
||
|
|
"#app": [
|
||
|
|
"definePayloadReducer",
|
||
|
|
"definePageMeta",
|
||
|
|
"onPrehydrate"
|
||
|
|
]
|
||
|
|
}) }
|
||
|
|
} },
|
||
|
|
asyncTransforms: {
|
||
|
|
asyncFunctions: ["defineNuxtPlugin", "defineNuxtRouteMiddleware"],
|
||
|
|
objectDefinitions: {
|
||
|
|
defineNuxtComponent: ["asyncData", "setup"],
|
||
|
|
defineNuxtPlugin: ["setup"],
|
||
|
|
definePageMeta: ["middleware", "validate"]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
// src/utils/workspace-dir.ts
|
||
|
|
const DECLARES_DENO_WORKSPACE_RE = /"workspace"\s*:/;
|
||
|
|
/** Workspace files, with the pattern a file has to match to declare a workspace. */
|
||
|
|
const WORKSPACE_FILES = [
|
||
|
|
["pnpm-workspace.yaml", /^packages\s*:/m],
|
||
|
|
["lerna.json"],
|
||
|
|
["turbo.json"],
|
||
|
|
["rush.json"],
|
||
|
|
["deno.json", DECLARES_DENO_WORKSPACE_RE],
|
||
|
|
["deno.jsonc", DECLARES_DENO_WORKSPACE_RE]
|
||
|
|
];
|
||
|
|
async function declaresWorkspace(dir) {
|
||
|
|
for (const [file, declaresWorkspace] of WORKSPACE_FILES) {
|
||
|
|
const path = join(dir, file);
|
||
|
|
if (!existsSync(path)) continue;
|
||
|
|
if (!declaresWorkspace || declaresWorkspace.test(await readFile(path, "utf8").catch(() => ""))) return true;
|
||
|
|
}
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
async function declaresPackageWorkspaces(path) {
|
||
|
|
try {
|
||
|
|
var _JSON$parse;
|
||
|
|
return !!((_JSON$parse = JSON.parse(await readFile(path, "utf8"))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.workspaces);
|
||
|
|
} catch {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Resolve the workspace directory of a project: the furthest directory with a file declaring a
|
||
|
|
* workspace, the closest git repository, or the closest `package.json` declaring `workspaces`,
|
||
|
|
* in that order. Falls back to `rootDir`.
|
||
|
|
*/
|
||
|
|
async function findWorkspaceDir(rootDir) {
|
||
|
|
const dirs = [];
|
||
|
|
for (let dir = rootDir;; dir = dirname(dir)) {
|
||
|
|
dirs.push(dir);
|
||
|
|
if (dirname(dir) === dir) break;
|
||
|
|
}
|
||
|
|
for (const dir of [...dirs].reverse()) if (await declaresWorkspace(dir)) return dir;
|
||
|
|
const gitDir = dirs.find((dir) => existsSync(join(dir, ".git/config")));
|
||
|
|
if (gitDir) return gitDir;
|
||
|
|
for (const dir of dirs) {
|
||
|
|
const path = join(dir, "package.json");
|
||
|
|
if (existsSync(path) && await declaresPackageWorkspaces(path)) return dir;
|
||
|
|
}
|
||
|
|
return rootDir;
|
||
|
|
}
|
||
|
|
/** Default extensions for JavaScript/TypeScript files, in order of resolution priority. */
|
||
|
|
const DEFAULT_JS_FILE_EXTENSIONS = [
|
||
|
|
".mjs",
|
||
|
|
".js",
|
||
|
|
".cjs",
|
||
|
|
".mts",
|
||
|
|
".ts",
|
||
|
|
".cts",
|
||
|
|
...[".tsx", ".jsx"]
|
||
|
|
];
|
||
|
|
// src/config/common.ts
|
||
|
|
var common_default = defineResolvers({
|
||
|
|
extends: void 0,
|
||
|
|
compatibilityDate: void 0,
|
||
|
|
theme: void 0,
|
||
|
|
rootDir: { $resolve: (val) => typeof val === "string" ? resolve(val) : process.cwd() },
|
||
|
|
workspaceDir: { $resolve: async (val, get) => {
|
||
|
|
const rootDir = await get("rootDir");
|
||
|
|
return val && typeof val === "string" ? resolve(rootDir, val) : findWorkspaceDir(rootDir);
|
||
|
|
} },
|
||
|
|
srcDir: { $resolve: async (val, get) => {
|
||
|
|
if (val && typeof val === "string") return resolve(await get("rootDir"), val);
|
||
|
|
const rootDir = await get("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 dirs = await Promise.all([
|
||
|
|
"assets",
|
||
|
|
"layouts",
|
||
|
|
"middleware",
|
||
|
|
"pages",
|
||
|
|
"plugins"
|
||
|
|
].map((key) => get(`dir.${key}`)));
|
||
|
|
for (const dir of dirs) if (existsSync(resolve(rootDir, dir))) return rootDir;
|
||
|
|
}
|
||
|
|
return srcDir;
|
||
|
|
} },
|
||
|
|
serverDir: { $resolve: async (val, get) => {
|
||
|
|
const rootDir = await get("rootDir");
|
||
|
|
return resolve(rootDir, val && typeof val === "string" ? val : "server");
|
||
|
|
} },
|
||
|
|
buildDir: { $resolve: async (val, get) => {
|
||
|
|
const rootDir = await get("rootDir");
|
||
|
|
return resolve(rootDir, val && typeof val === "string" ? val : ".nuxt");
|
||
|
|
} },
|
||
|
|
typesDir: { $resolve: async (val, get) => {
|
||
|
|
if (val && typeof val === "string") return resolve(await get("rootDir"), val);
|
||
|
|
return get("buildDir");
|
||
|
|
} },
|
||
|
|
appId: { $resolve: (val) => val && typeof val === "string" ? val : "nuxt-app" },
|
||
|
|
buildId: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string") return val;
|
||
|
|
const [isDev, isTest] = await Promise.all([get("dev"), get("test")]);
|
||
|
|
return isDev ? "dev" : isTest ? "test" : randomUUID();
|
||
|
|
} },
|
||
|
|
modulesDir: {
|
||
|
|
$default: ["node_modules"],
|
||
|
|
$resolve: async (val, get) => {
|
||
|
|
const rootDir = await get("rootDir");
|
||
|
|
const modulesDir = /* @__PURE__ */ new Set([resolve(rootDir, "node_modules")]);
|
||
|
|
if (Array.isArray(val)) {
|
||
|
|
for (const dir of val) if (dir && typeof dir === "string") modulesDir.add(resolve(rootDir, dir));
|
||
|
|
}
|
||
|
|
return [...modulesDir];
|
||
|
|
}
|
||
|
|
},
|
||
|
|
analyzeDir: { $resolve: async (val, get) => val && typeof val === "string" ? resolve(await get("rootDir"), val) : resolve(await get("buildDir"), "analyze") },
|
||
|
|
dev: { $resolve: (val) => typeof val === "boolean" ? val : Boolean(isDevelopment) },
|
||
|
|
test: { $resolve: (val) => typeof val === "boolean" ? val : Boolean(isTest) },
|
||
|
|
envName: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string") return val;
|
||
|
|
return await get("dev") ? "development" : "production";
|
||
|
|
} },
|
||
|
|
debug: { $resolve: (val) => {
|
||
|
|
val ?? (val = isDebug);
|
||
|
|
if (val === true) return {
|
||
|
|
templates: true,
|
||
|
|
modules: true,
|
||
|
|
watchers: true,
|
||
|
|
hooks: {
|
||
|
|
client: true,
|
||
|
|
server: true
|
||
|
|
},
|
||
|
|
nitro: true,
|
||
|
|
router: true,
|
||
|
|
hydration: true,
|
||
|
|
perf: process.env.NUXT_DEBUG_PERF === "quiet" ? "quiet" : true
|
||
|
|
};
|
||
|
|
if (val && typeof val === "object") {
|
||
|
|
if (process.env.NUXT_DEBUG_PERF) val.perf = process.env.NUXT_DEBUG_PERF === "quiet" ? "quiet" : true;
|
||
|
|
return val;
|
||
|
|
}
|
||
|
|
if (process.env.NUXT_DEBUG_PERF) return { perf: process.env.NUXT_DEBUG_PERF === "quiet" ? "quiet" : true };
|
||
|
|
return false;
|
||
|
|
} },
|
||
|
|
ssr: { $resolve: (val) => typeof val === "boolean" ? val : true },
|
||
|
|
modules: { $resolve: (val) => {
|
||
|
|
const modules = [];
|
||
|
|
if (Array.isArray(val)) for (const mod of val) {
|
||
|
|
if (!mod) continue;
|
||
|
|
if (typeof mod === "string" || typeof mod === "function" || Array.isArray(mod) && mod[0]) modules.push(mod);
|
||
|
|
}
|
||
|
|
return modules;
|
||
|
|
} },
|
||
|
|
dir: {
|
||
|
|
app: { $resolve: async (val, get) => {
|
||
|
|
const [srcDir, rootDir] = await Promise.all([get("srcDir"), get("rootDir")]);
|
||
|
|
return resolve(await get("srcDir"), val && typeof val === "string" ? val : srcDir === rootDir ? "app" : ".");
|
||
|
|
} },
|
||
|
|
assets: "assets",
|
||
|
|
layouts: "layouts",
|
||
|
|
middleware: "middleware",
|
||
|
|
modules: { $resolve: async (val, get) => {
|
||
|
|
return resolve(await get("rootDir"), val && typeof val === "string" ? val : "modules");
|
||
|
|
} },
|
||
|
|
pages: "pages",
|
||
|
|
plugins: "plugins",
|
||
|
|
shared: { $resolve: (val) => {
|
||
|
|
return val && typeof val === "string" ? val : "shared";
|
||
|
|
} },
|
||
|
|
public: { $resolve: async (val, get) => {
|
||
|
|
return resolve(await get("rootDir"), val && typeof val === "string" ? val : "public");
|
||
|
|
} }
|
||
|
|
},
|
||
|
|
extensions: { $resolve: (val) => {
|
||
|
|
const extensions = [...DEFAULT_JS_FILE_EXTENSIONS, ".vue"];
|
||
|
|
if (Array.isArray(val)) {
|
||
|
|
for (const item of val) if (item && typeof item === "string") extensions.push(item);
|
||
|
|
}
|
||
|
|
return extensions;
|
||
|
|
} },
|
||
|
|
alias: { $resolve: async (val, get) => {
|
||
|
|
const [srcDir, rootDir, buildDir, sharedDir, serverDir] = await Promise.all([
|
||
|
|
get("srcDir"),
|
||
|
|
get("rootDir"),
|
||
|
|
get("buildDir"),
|
||
|
|
get("dir.shared"),
|
||
|
|
get("serverDir")
|
||
|
|
]);
|
||
|
|
const srcWithTrailingSlash = withTrailingSlash(srcDir);
|
||
|
|
const rootWithTrailingSlash = withTrailingSlash(rootDir);
|
||
|
|
return {
|
||
|
|
"~": srcWithTrailingSlash,
|
||
|
|
"@": srcWithTrailingSlash,
|
||
|
|
"~~": rootWithTrailingSlash,
|
||
|
|
"@@": rootWithTrailingSlash,
|
||
|
|
"#shared": withTrailingSlash(resolve(rootDir, sharedDir)),
|
||
|
|
"#server": withTrailingSlash(serverDir),
|
||
|
|
"#build": withTrailingSlash(buildDir),
|
||
|
|
"#internal/nuxt/paths": resolve(buildDir, "paths.mjs"),
|
||
|
|
...typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
ignoreOptions: void 0,
|
||
|
|
ignorePrefix: { $resolve: (val) => val && typeof val === "string" ? val : "-" },
|
||
|
|
ignore: { $resolve: async (val, get) => {
|
||
|
|
const [rootDir, ignorePrefix, analyzeDir, buildDir] = await Promise.all([
|
||
|
|
get("rootDir"),
|
||
|
|
get("ignorePrefix"),
|
||
|
|
get("analyzeDir"),
|
||
|
|
get("buildDir")
|
||
|
|
]);
|
||
|
|
const ignore = /* @__PURE__ */ new Set([
|
||
|
|
"**/*.stories.{js,cts,mts,ts,jsx,tsx}",
|
||
|
|
"**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}",
|
||
|
|
"**/*.d.{cts,mts,ts}",
|
||
|
|
"**/*.d.vue.{cts,mts,ts}",
|
||
|
|
"**/.{pnpm-store,vercel,netlify,wrangler,output,git,cache,data,direnv}",
|
||
|
|
"/vendor",
|
||
|
|
"**/node-compile-cache",
|
||
|
|
"**/test-results",
|
||
|
|
"**/*.sock",
|
||
|
|
relative(rootDir, analyzeDir),
|
||
|
|
relative(rootDir, buildDir)
|
||
|
|
]);
|
||
|
|
if (ignorePrefix) ignore.add(`**/${ignorePrefix}*.*`);
|
||
|
|
if (Array.isArray(val)) {
|
||
|
|
for (const pattern of val) if (pattern) ignore.add(pattern);
|
||
|
|
}
|
||
|
|
return [...ignore];
|
||
|
|
} },
|
||
|
|
watch: { $resolve: (val) => {
|
||
|
|
if (Array.isArray(val)) return val.filter((b) => typeof b === "string" || b instanceof RegExp);
|
||
|
|
return [];
|
||
|
|
} },
|
||
|
|
watchers: {
|
||
|
|
rewatchOnRawEvents: void 0,
|
||
|
|
webpack: { aggregateTimeout: 1e3 },
|
||
|
|
chokidar: {
|
||
|
|
ignoreInitial: true,
|
||
|
|
ignorePermissionErrors: true
|
||
|
|
}
|
||
|
|
},
|
||
|
|
hooks: void 0,
|
||
|
|
runtimeConfig: { $resolve: async (_val, get) => {
|
||
|
|
const val = _val && typeof _val === "object" ? _val : {};
|
||
|
|
const [app, buildId] = await Promise.all([get("app"), get("buildId")]);
|
||
|
|
provideFallbackValues(val);
|
||
|
|
return defu(val, {
|
||
|
|
appSecret: "",
|
||
|
|
public: {},
|
||
|
|
app: {
|
||
|
|
buildId,
|
||
|
|
baseURL: app.baseURL,
|
||
|
|
buildAssetsDir: app.buildAssetsDir,
|
||
|
|
cdnURL: app.cdnURL
|
||
|
|
}
|
||
|
|
});
|
||
|
|
} },
|
||
|
|
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]);
|
||
|
|
}
|
||
|
|
function withTrailingSlash(str) {
|
||
|
|
return str.replace(/\/?$/, "/");
|
||
|
|
}
|
||
|
|
// src/templates/loading.ts
|
||
|
|
const _messages = {
|
||
|
|
"appName": "Nuxt",
|
||
|
|
"loading": "Loading"
|
||
|
|
};
|
||
|
|
const template = (messages) => {
|
||
|
|
messages = {
|
||
|
|
..._messages,
|
||
|
|
...messages
|
||
|
|
};
|
||
|
|
return "<!DOCTYPE html><html lang=\"en\"><head><title data-app-name=\"" + escapeHtml(messages.appName) + "\">" + escapeHtml(messages.loading) + " | " + escapeHtml(messages.appName) + "</title><meta charset=\"utf-8\"><meta content=\"width=device-width,initial-scale=1,minimum-scale=1\" name=\"viewport\"><style>:root{--nuxt-mint:#00dc82;--nuxt-mist:#e8fff4e0;--nuxt-dim:#00dc828c;--nuxt-logo:calc(min(10vw, 68px))}*,:after,:before{box-sizing:border-box}body,html{width:100%;height:100%;color:var(--nuxt-mist);background:#000;margin:0}body{-webkit-font-smoothing:antialiased;justify-content:center;align-items:center;font-family:ui-sans-serif,system-ui,sans-serif;display:flex;overflow:hidden}#nuxt-shader,svg{display:block}#nuxt-shader{z-index:0;touch-action:none;opacity:0;width:100%;height:100%;transition:opacity .4s;position:fixed;inset:0}.nuxt-lockup{z-index:1;color:inherit;cursor:pointer;background:0 0;border:0;align-items:center;padding:0;display:flex;position:relative}.nuxt-logo-slot{width:var(--nuxt-logo);height:calc(var(--nuxt-logo) * 2 / 3);flex:0 0 var(--nuxt-logo);color:var(--nuxt-mint)}.nuxt-logo-slot>svg{width:100%;height:100%}.nuxt-logo-slot>svg>path{fill:currentColor}.nuxt-loader-bar{z-index:1;width:var(--nuxt-progress,4%);background:var(--nuxt-mint);height:2px;transition:width .3s;position:fixed;bottom:0;left:0;right:auto}.nuxt-season{z-index:1;width:30px;height:30px;color:var(--nuxt-mint);cursor:pointer;background:#00dc8214;border:1px solid #00dc823d;border-radius:8px;justify-content:center;align-items:center;padding:0;transition:opacity .2s,background-color .2s;display:flex;position:fixed;bottom:26px;right:22px}.nuxt-season[hidden]{display:none}.nuxt-season:hover{background:#00dc8229}.nuxt-season>svg{width:16px;height:16px}.nuxt-sr{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media(prefers-color-scheme:light){:root{--nuxt-mist:#0a0a0ac2;--nuxt-dim:#0a0a0a6b;--nuxt-accent:#00a86a}body,html{background:#fff}}</style><script>var e=/swiftshader|llvmpipe|softpipe|software|basic render/i,t=.55;function n(e,t,n,o){let a=1-Math.exp(-Math.min(Math.max(n,0),.05)/Math.max(o,.001));return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function r(){try{let e=new URLSearchParams(window.location.search).get(\"winter\");if(null!==e)return\"0\"!==e&&\"false\"!==e}catch{}let e=new Date,t=e.getFullYear(),n=-new Date(t,0,1).getTimezoneOffset(),o=-new Date(t,6,1).getTimezoneOffset();return n!==o&&(n-o>0?[4,5,6]:[10,11,0]).includes(e.getMonth())}function i(o,a,i){let s,l,c,h,d,f,u=!1,p=0,m=1,v=1,w=[.5,.5],g=[.1,.1],x=[.5,.5],E=0,y=new Float32Array(8).fill(-1),k=-1,L=0,b=-1/0,A=!1,S=!1,P=!1,R=!1,M=0,_=0,C=0,N=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,T=window.matchMedia(\"(prefers-color-scheme: light)\"),z=+!!T.matches,O=+!!r(),I=()=>{u||S||!A||(b=-1/0,p||=requestAnimationFrame(B))},F=e=>{z=+!!e.matches,W(),I()},W=()=>{s&&(z>0?s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE):s.blendFuncSeparate(s.ONE,s.ONE,s.ONE,s.ONE))},q=()=>{if(!s)return;let e=o.getBoundingClientRect();if(e.width<=0||e.height<=0)return;let t=Math.min(window.devicePixelRatio||1,1.75,2688/e.width),n=[Math.max(1,Math.floor(e.width*t)),Math.max(1,Math.floor(e.height*t))];(n[0]!==m||n[1]!==v)&&(m=n[0],v=n[1],o.width=m,o.height=v,s.viewport(0,0,m,v));let i=a.getBoundingClientRect();w=[(i.left+i.width/2-e.left)/Math.max(1,e.width),(i.top+i.height/2-e.top)/Math.max(1,e.height)],g=[Math.max(.001,i.width/Math.max(1,e.width)),Math.max(.001,i.height/Math.max(1,e.height))]},H=e=>{if(\"touch\"===e.pointerType)return;let t=o.getBoundingClientRect();h=[Math.min(1,Math.max(0,(e.clientX-t.left)/Math.max(1,t.width))),Math.min(1,Math.max(0,(e.clientY-t.top)/Math.max(1,t.height)))]},D=()=>{h=void 0},U=()=>{let e=y.findIndex(e=>e<0);e<0&&(e=y.indexOf(Math.max(...y))),y[e]=0,I()},K=e=>{\"touch\"!==e.pointerType&&(k=0,I())},Z=e=>{e.preventDefault(),V(),o.remove()},X=e=>{e===S||u||(e&&!A?P=!0:(S=e,S?(M=_,h=void 0,p&&cancelAnimationFrame(p),p=0):(P=!1,R=!0,p||=requestAnimationFrame(B))))},B=e=>{if(u||(p=requestAnim
|
||
|
|
};
|
||
|
|
// src/config/dev.ts
|
||
|
|
var dev_default = defineResolvers({ devServer: {
|
||
|
|
https: false,
|
||
|
|
port: Number(process.env.NUXT_PORT || process.env.NITRO_PORT || process.env.PORT || 3e3),
|
||
|
|
host: { $resolve: (val) => typeof val === "string" && val ? val : process.env.NUXT_HOST || process.env.NITRO_HOST || process.env.HOST || void 0 },
|
||
|
|
allowedHosts: { $resolve: async (val, get) => {
|
||
|
|
const [host, viteAllowedHosts] = await Promise.all([get("devServer.host"), get("vite.server").then((r) => r === null || r === void 0 ? void 0 : r.allowedHosts)]);
|
||
|
|
if (val === true || viteAllowedHosts === true) return true;
|
||
|
|
const hosts = [
|
||
|
|
...Array.isArray(val) ? val : [],
|
||
|
|
...Array.isArray(viteAllowedHosts) ? viteAllowedHosts : [],
|
||
|
|
host
|
||
|
|
];
|
||
|
|
return [...new Set(hosts.filter((h) => typeof h === "string" && !!h))];
|
||
|
|
} },
|
||
|
|
url: "http://localhost:3000",
|
||
|
|
loadingTemplate: template,
|
||
|
|
errorChannel: "/__nuxt_dev__/error",
|
||
|
|
cors: { origin: [/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/] }
|
||
|
|
} });
|
||
|
|
// src/config/esbuild.ts
|
||
|
|
var esbuild_default = defineResolvers({ esbuild: { options: {
|
||
|
|
target: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string") return val;
|
||
|
|
const builder = await get("builder");
|
||
|
|
if (!builder || builder === "vite" || builder === "@nuxt/vite-builder") return "esnext";
|
||
|
|
if (await get("experimental").then((r) => (r === null || r === void 0 ? void 0 : r.decorators) === true)) return "es2024";
|
||
|
|
return "esnext";
|
||
|
|
} },
|
||
|
|
jsxFactory: "h",
|
||
|
|
jsxFragment: "Fragment",
|
||
|
|
tsconfigRaw: { $resolve: async (_val, get) => {
|
||
|
|
const val = typeof _val === "string" ? JSON.parse(_val) : _val && typeof _val === "object" ? _val : {};
|
||
|
|
if (!await get("experimental").then((r) => (r === null || r === void 0 ? void 0 : r.decorators) === true)) return val;
|
||
|
|
return defu({ compilerOptions: { experimentalDecorators: false } }, val);
|
||
|
|
} }
|
||
|
|
} } });
|
||
|
|
// src/config/oxc.ts
|
||
|
|
var oxc_default = defineResolvers({ oxc: { transform: { options: {
|
||
|
|
target: "esnext",
|
||
|
|
jsxFactory: "h",
|
||
|
|
jsxFragment: "Fragment"
|
||
|
|
} } } });
|
||
|
|
// src/config/experimental.ts
|
||
|
|
var experimental_default = defineResolvers({
|
||
|
|
future: {
|
||
|
|
compatibilityVersion: { $resolve: (val) => typeof val === "number" ? val : 4 },
|
||
|
|
multiApp: false,
|
||
|
|
typescriptBundlerResolution: { async $resolve(val, get) {
|
||
|
|
val = typeof val === "boolean" ? val : await get("experimental").then((e) => e === null || e === void 0 ? void 0 : e.typescriptBundlerResolution);
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
const setting = await get("typescript.tsConfig").then((r) => {
|
||
|
|
var _r$compilerOptions;
|
||
|
|
return r === null || r === void 0 || (_r$compilerOptions = r.compilerOptions) === null || _r$compilerOptions === void 0 ? void 0 : _r$compilerOptions.moduleResolution;
|
||
|
|
});
|
||
|
|
if (setting) return setting.toLowerCase() === "bundler";
|
||
|
|
return true;
|
||
|
|
} }
|
||
|
|
},
|
||
|
|
features: {
|
||
|
|
inlineStyles: { async $resolve(_val, get) {
|
||
|
|
const val = typeof _val === "boolean" || typeof _val === "function" ? _val : await get("experimental").then((e) => e === null || e === void 0 ? void 0 : e.inlineSSRStyles);
|
||
|
|
if (val === false || await get("dev") || await get("ssr") === false) return false;
|
||
|
|
return val ?? ((id) => !!id && id.includes(".vue"));
|
||
|
|
} },
|
||
|
|
devLogs: { async $resolve(val, get) {
|
||
|
|
if (typeof val === "boolean" || val === "silent") return val;
|
||
|
|
const [isDev, isTest] = await Promise.all([get("dev"), get("test")]);
|
||
|
|
return isDev && !isTest;
|
||
|
|
} },
|
||
|
|
noScripts: { async $resolve(val, get) {
|
||
|
|
const isValidLiteral = (val) => {
|
||
|
|
return typeof val === "string" && ["production", "all"].includes(val);
|
||
|
|
};
|
||
|
|
return val === true ? "production" : val === false || isValidLiteral(val) ? val : await get("experimental").then((e) => (e === null || e === void 0 ? void 0 : e.noScripts) && "production") ?? false;
|
||
|
|
} }
|
||
|
|
},
|
||
|
|
experimental: {
|
||
|
|
routeTypedFetch: { $resolve: async (val, get) => typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5 },
|
||
|
|
strictRouteTypes: { async $resolve(val, get) {
|
||
|
|
if (!await get("experimental.routeTypedFetch")) return false;
|
||
|
|
return val === "isomorphic" || typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
runtimeBaseURL: false,
|
||
|
|
decorators: false,
|
||
|
|
asyncEntry: { $resolve: (val) => typeof val === "boolean" ? val : false },
|
||
|
|
externalVue: true,
|
||
|
|
serverAppConfig: true,
|
||
|
|
emitRouteChunkError: { $resolve: (val) => {
|
||
|
|
if (val === true) return "manual";
|
||
|
|
if (val === "reload") return "automatic";
|
||
|
|
if (val === false) return false;
|
||
|
|
if (typeof val === "string" && (/* @__PURE__ */ new Set([
|
||
|
|
"manual",
|
||
|
|
"automatic",
|
||
|
|
"automatic-immediate"
|
||
|
|
])).has(val)) return val;
|
||
|
|
return "automatic";
|
||
|
|
} },
|
||
|
|
templateRouteInjection: true,
|
||
|
|
restoreState: false,
|
||
|
|
renderJsonPayloads: true,
|
||
|
|
noVueServer: false,
|
||
|
|
/**
|
||
|
|
* Extract the data payloads of prerendered and ISR/SWR pages into `_payload.json` files that are reused during client-side navigation.
|
||
|
|
*
|
||
|
|
* - `'client'`: inline the payload in the HTML for the initial render and extract it to a `_payload.json` file for client-side navigation.
|
||
|
|
* - `true`: extract the payload to a `_payload.json` file for both the initial render and client-side navigation.
|
||
|
|
* - `false`: disable payload extraction entirely; the payload is always inlined in the HTML.
|
||
|
|
*
|
||
|
|
* Defaults to `true`, or `'client'` when `future.compatibilityVersion` is `5` or higher. It is forced to `false` when `ssr` is disabled.
|
||
|
|
* @see [Payload Extraction documentation](https://nuxt.com/docs/getting-started/prerendering#payload-extraction)
|
||
|
|
*/
|
||
|
|
payloadExtraction: { $resolve: async (val, get) => {
|
||
|
|
if (await get("ssr") === false) return false;
|
||
|
|
if (val === "client" || typeof val === "boolean") return val;
|
||
|
|
return await get("future.compatibilityVersion") >= 5 ? "client" : true;
|
||
|
|
} },
|
||
|
|
/**
|
||
|
|
* Render the error page in the Nuxt renderer itself when a server render fails, rather than
|
||
|
|
* handing the error to the server runtime and re-entering the renderer over an internal request.
|
||
|
|
*
|
||
|
|
* The error page is rendered in process, on the same request event, so the response keeps the
|
||
|
|
* headers and cookies the failed render had already written. Page errors return the error page
|
||
|
|
* and server route errors return JSON. When disabled, the request headers determine the format.
|
||
|
|
*
|
||
|
|
* Defaults to `true` when `future.compatibilityVersion` is `5` or higher.
|
||
|
|
*/
|
||
|
|
inlineErrorRendering: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
return await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
/**
|
||
|
|
* Server-render static error pages (such as `404.html`) when prerendering, rather than emitting an empty SPA shell.
|
||
|
|
*
|
||
|
|
* Pass an array of status codes between 400 and 599 to control which error pages are generated. `true` is equivalent to `[404]`.
|
||
|
|
* @type {boolean | number[]}
|
||
|
|
*/
|
||
|
|
prerenderErrorPages: { $resolve: (val) => {
|
||
|
|
if (!Array.isArray(val)) return !!val;
|
||
|
|
return val.filter((status) => {
|
||
|
|
if (Number.isInteger(status) && status >= 400 && status <= 599) return true;
|
||
|
|
schemaDiagnostics.NUXT_B5020({ status: String(status) });
|
||
|
|
return false;
|
||
|
|
});
|
||
|
|
} },
|
||
|
|
/**
|
||
|
|
* Respond with an early 404 error for requests whose path cannot match any page route,
|
||
|
|
* without loading the Vue app, its plugins or middleware on the server.
|
||
|
|
*
|
||
|
|
* Page routes (including aliases) are converted to route patterns at build time and
|
||
|
|
* requests are checked against them before server-side rendering begins.
|
||
|
|
*
|
||
|
|
* This is opt-in as it can break apps that rely on runtime routing: pages added
|
||
|
|
* dynamically with `router.addRoute()` (on the server or the client), or route
|
||
|
|
* middleware that redirects unknown paths to existing ones. It also applies to
|
||
|
|
* `ssr: false` routes, which respond with a 404 error rather than the SPA shell when
|
||
|
|
* no page can match. The option is disabled automatically in development, when using
|
||
|
|
* `hashMode`, with a root-level catch-all page, and when a custom `app/router.options`
|
||
|
|
* file may modify `routes`.
|
||
|
|
*/
|
||
|
|
early404: false,
|
||
|
|
clientFallback: false,
|
||
|
|
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 {ViewTransitionOptions['enabled'] | ViewTransitionOptions}
|
||
|
|
*/
|
||
|
|
viewTransition: false,
|
||
|
|
writeEarlyHints: false,
|
||
|
|
componentIslands: { $resolve: (val) => {
|
||
|
|
if (val === "local+remote") return { remoteIsland: true };
|
||
|
|
if (val === "local") return true;
|
||
|
|
return val ?? "auto";
|
||
|
|
} },
|
||
|
|
localLayerAliases: true,
|
||
|
|
typedPages: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
return await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
serverPathFallback: { $resolve: (val) => typeof val === "boolean" ? val : true },
|
||
|
|
appManifest: true,
|
||
|
|
checkOutdatedBuildInterval: 36e5,
|
||
|
|
watcher: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string" && (/* @__PURE__ */ new Set([
|
||
|
|
"chokidar",
|
||
|
|
"parcel",
|
||
|
|
"chokidar-granular",
|
||
|
|
"builder"
|
||
|
|
])).has(val)) return val;
|
||
|
|
if (await get("future.compatibilityVersion") >= 5) return "builder";
|
||
|
|
const [srcDir, rootDir] = await Promise.all([get("srcDir"), get("rootDir")]);
|
||
|
|
if (srcDir === rootDir) return "chokidar-granular";
|
||
|
|
return "chokidar";
|
||
|
|
} },
|
||
|
|
asyncContext: false,
|
||
|
|
headNext: true,
|
||
|
|
inlineRouteRules: false,
|
||
|
|
scanPageMeta: { $resolve(val) {
|
||
|
|
return typeof val === "boolean" || val === "after-resolve" ? val : "after-resolve";
|
||
|
|
} },
|
||
|
|
extraPageMetaExtractionKeys: [],
|
||
|
|
extractSerializablePageMeta: { async $resolve(val, get) {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
sharedPrerenderData: { $resolve(val) {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
cookieStore: true,
|
||
|
|
defaults: {
|
||
|
|
nuxtLink: {
|
||
|
|
componentName: "NuxtLink",
|
||
|
|
prefetch: true,
|
||
|
|
prefetchOn: { visibility: true }
|
||
|
|
},
|
||
|
|
useAsyncData: { deep: false },
|
||
|
|
useState: { resetOnClear: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} } },
|
||
|
|
useFetch: {}
|
||
|
|
},
|
||
|
|
clientNodeCompat: false,
|
||
|
|
navigationRepaint: true,
|
||
|
|
navigateToEarlyReturn: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
buildCache: false,
|
||
|
|
normalizeComponentNames: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
normalizePageNames: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
spaLoadingTemplateLocation: { $resolve: (val) => {
|
||
|
|
return typeof val === "string" && (/* @__PURE__ */ new Set(["body", "within"])).has(val) ? val : "body";
|
||
|
|
} },
|
||
|
|
browserDevtoolsTiming: { $resolve: (val, get) => typeof val === "boolean" ? val : get("dev") },
|
||
|
|
chromeDevtoolsProjectSettings: true,
|
||
|
|
debugModuleMutation: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : Boolean(await get("debug"));
|
||
|
|
} },
|
||
|
|
lazyHydration: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
templateImportResolution: true,
|
||
|
|
purgeCachedData: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
prefetchPreloadTags: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
granularCachedData: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
stripNeverHydratedData: false,
|
||
|
|
alwaysRunFetchOnKeyChange: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
parseErrorData: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : true;
|
||
|
|
} },
|
||
|
|
enforceModuleCompatibility: false,
|
||
|
|
pendingWhenIdle: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
entryImportMap: true,
|
||
|
|
extractAsyncDataHandlers: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
viteEnvironmentApi: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
nitroAutoImports: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") < 5;
|
||
|
|
} },
|
||
|
|
nitroViteEnvironment: { $resolve: () => false },
|
||
|
|
typescriptPlugin: { $resolve: (val) => {
|
||
|
|
return typeof val === "boolean" ? val : false;
|
||
|
|
} },
|
||
|
|
ssrStreaming: { $resolve(val) {
|
||
|
|
const defaultBotRegex = /bot\b|crawl|spider|slurp|facebookexternalhit|google\b|bing\b|yandex\b|baidu\b|duckduck/i;
|
||
|
|
const obj = val !== null && typeof val === "object" ? val : null;
|
||
|
|
if (!(val === true || obj !== null && obj.enabled !== false)) return {
|
||
|
|
enabled: false,
|
||
|
|
botRegex: defaultBotRegex
|
||
|
|
};
|
||
|
|
return {
|
||
|
|
enabled: true,
|
||
|
|
botRegex: (obj === null || obj === void 0 ? void 0 : obj.botRegex) instanceof RegExp ? obj.botRegex : defaultBotRegex
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
asyncCallHook: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") < 5;
|
||
|
|
} },
|
||
|
|
clientNodePlaceholder: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} },
|
||
|
|
clearBuildHooks: true
|
||
|
|
}
|
||
|
|
});
|
||
|
|
// src/config/generate.ts
|
||
|
|
var generate_default = defineResolvers({ generate: {
|
||
|
|
routes: [],
|
||
|
|
exclude: []
|
||
|
|
} });
|
||
|
|
// src/config/internal.ts
|
||
|
|
var internal_default = defineResolvers({
|
||
|
|
_majorVersion: 4,
|
||
|
|
_nitroMajor: 2,
|
||
|
|
_legacyGenerate: false,
|
||
|
|
_start: false,
|
||
|
|
_build: false,
|
||
|
|
_generate: false,
|
||
|
|
_prepare: false,
|
||
|
|
_cli: false,
|
||
|
|
_requiredModules: {},
|
||
|
|
_loadOptions: void 0,
|
||
|
|
_nuxtConfigFile: void 0,
|
||
|
|
_nuxtConfigFiles: [],
|
||
|
|
appDir: "",
|
||
|
|
_installedModules: [],
|
||
|
|
_modules: [],
|
||
|
|
_noScriptsPageSources: []
|
||
|
|
});
|
||
|
|
// src/config/nitro.ts
|
||
|
|
const serverBuilders = {
|
||
|
|
nitro: "@nuxt/nitro-server",
|
||
|
|
vite: "@nuxt/vite-server"
|
||
|
|
};
|
||
|
|
var nitro_default = defineResolvers({
|
||
|
|
server: { builder: { $resolve: (val) => {
|
||
|
|
if (typeof val === "string") return serverBuilders[val] ?? val;
|
||
|
|
if (val && typeof val === "object" && "bundle" in val) return val;
|
||
|
|
return "@nuxt/nitro-server";
|
||
|
|
} } },
|
||
|
|
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: Object.assign({ envPrefix: "NUXT_" }, runtimeConfig.nitro)
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
routeRules: { $resolve: async (val, get) => {
|
||
|
|
return {
|
||
|
|
...await get("routeRules"),
|
||
|
|
...val && typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
prerender: { $resolve: async (val, get) => {
|
||
|
|
return {
|
||
|
|
...await get("prerender"),
|
||
|
|
...val && typeof val === "object" ? val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
tracingChannel: { $resolve: async (val, get) => {
|
||
|
|
if (val === false) return false;
|
||
|
|
const topLevel = await get("tracingChannel");
|
||
|
|
const base = typeof topLevel === "object" ? topLevel : null;
|
||
|
|
const override = val && typeof val === "object" ? val : null;
|
||
|
|
if (!base && !override) return val === true ? {} : false;
|
||
|
|
return {
|
||
|
|
...base || {},
|
||
|
|
...override || {}
|
||
|
|
};
|
||
|
|
} }
|
||
|
|
},
|
||
|
|
routeRules: {},
|
||
|
|
prerender: {},
|
||
|
|
serverHandlers: [],
|
||
|
|
devServerHandlers: [],
|
||
|
|
_serverPlugins: [],
|
||
|
|
tracingChannel: { $resolve: (val) => {
|
||
|
|
if (val === true) return { nuxt: true };
|
||
|
|
if (val && typeof val === "object") return {
|
||
|
|
nuxt: true,
|
||
|
|
...val
|
||
|
|
};
|
||
|
|
return false;
|
||
|
|
} }
|
||
|
|
});
|
||
|
|
// src/config/postcss.ts
|
||
|
|
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));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var postcss_default = defineResolvers({ postcss: {
|
||
|
|
order: { $resolve: (val) => {
|
||
|
|
if (typeof val === "string") {
|
||
|
|
if (!(val in orderPresets)) throw schemaDiagnostics.NUXT_B5015({ preset: val });
|
||
|
|
return orderPresets[val];
|
||
|
|
}
|
||
|
|
if (typeof val === "function") return val;
|
||
|
|
if (Array.isArray(val)) return val;
|
||
|
|
return orderPresets.autoprefixerAndCssnanoLast;
|
||
|
|
} },
|
||
|
|
plugins: {
|
||
|
|
autoprefixer: { $resolve: async (val, get) => {
|
||
|
|
if (val || val === false) return val;
|
||
|
|
return await get("future.compatibilityVersion") >= 5 ? false : {};
|
||
|
|
} },
|
||
|
|
cssnano: { $resolve: async (val, get) => {
|
||
|
|
if (val || val === false) return val;
|
||
|
|
if (await get("dev") || await get("future.compatibilityVersion") >= 5) return false;
|
||
|
|
return {};
|
||
|
|
} }
|
||
|
|
}
|
||
|
|
} });
|
||
|
|
// src/config/router.ts
|
||
|
|
var router_default = defineResolvers({ router: { options: {
|
||
|
|
hashMode: false,
|
||
|
|
scrollBehaviorType: "auto",
|
||
|
|
sensitive: { $resolve: async (val, get) => {
|
||
|
|
return typeof val === "boolean" ? val : await get("future.compatibilityVersion") >= 5;
|
||
|
|
} }
|
||
|
|
} } });
|
||
|
|
// src/config/typescript.ts
|
||
|
|
var typescript_default = defineResolvers({ typescript: {
|
||
|
|
strict: true,
|
||
|
|
builder: { $resolve: (val) => {
|
||
|
|
if (typeof val === "string" && (/* @__PURE__ */ new Set([
|
||
|
|
"vite",
|
||
|
|
"webpack",
|
||
|
|
"rspack",
|
||
|
|
"shared"
|
||
|
|
])).has(val)) return val;
|
||
|
|
if (val === false) return false;
|
||
|
|
return null;
|
||
|
|
} },
|
||
|
|
hoist: { $resolve: (val) => {
|
||
|
|
const defaults = [
|
||
|
|
"@unhead/vue",
|
||
|
|
"@nuxt/devtools",
|
||
|
|
"vue",
|
||
|
|
"@vue/runtime-core",
|
||
|
|
"@vue/compiler-sfc",
|
||
|
|
"vue-router",
|
||
|
|
"vue-router/auto-routes",
|
||
|
|
"@nuxt/schema",
|
||
|
|
"nuxt"
|
||
|
|
];
|
||
|
|
return val === false ? [] : Array.isArray(val) ? val.concat(defaults) : defaults;
|
||
|
|
} },
|
||
|
|
includeWorkspace: false,
|
||
|
|
typeCheck: false,
|
||
|
|
tsConfig: {},
|
||
|
|
shim: false
|
||
|
|
} });
|
||
|
|
// src/config/vite.ts
|
||
|
|
var vite_default = defineResolvers({ vite: {
|
||
|
|
root: { $resolve: (val, get) => typeof val === "string" ? val : get("srcDir") },
|
||
|
|
mode: { $resolve: async (val, get) => typeof val === "string" ? val : await get("dev") ? "development" : "production" },
|
||
|
|
define: { $resolve: async (_val, get) => {
|
||
|
|
const [isDev, isTest, isDebug] = await Promise.all([
|
||
|
|
get("dev"),
|
||
|
|
get("test"),
|
||
|
|
get("debug")
|
||
|
|
]);
|
||
|
|
const optionsApi = (await get("vue")).optionsApi;
|
||
|
|
return {
|
||
|
|
"__VUE_OPTIONS_API__": Boolean(optionsApi),
|
||
|
|
"__VUE_PROD_DEVTOOLS__": false,
|
||
|
|
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": Boolean(isDebug && (isDebug === true || isDebug.hydration)),
|
||
|
|
"process.dev": isDev,
|
||
|
|
"import.meta.dev": isDev,
|
||
|
|
"process.test": isTest,
|
||
|
|
"import.meta.test": isTest,
|
||
|
|
..._val && typeof _val === "object" ? _val : {}
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
resolve: { extensions: [
|
||
|
|
...DEFAULT_JS_FILE_EXTENSIONS,
|
||
|
|
".vue",
|
||
|
|
".json"
|
||
|
|
] },
|
||
|
|
publicDir: { $resolve: (val) => {
|
||
|
|
if (val) schemaDiagnostics.NUXT_B5014();
|
||
|
|
return false;
|
||
|
|
} },
|
||
|
|
vue: {
|
||
|
|
isProduction: { $resolve: async (val, get) => typeof val === "boolean" ? 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) => {
|
||
|
|
var _await$get$compilerOp;
|
||
|
|
return typeof val === "boolean" ? val : (_await$get$compilerOp = (await get("vue")).compilerOptions) === null || _await$get$compilerOp === void 0 ? void 0 : _await$get$compilerOp.hoistStatic;
|
||
|
|
} } },
|
||
|
|
features: { propsDestructure: { $resolve: async (val, get) => {
|
||
|
|
var _vueOptions$script;
|
||
|
|
if (typeof val === "boolean") return val;
|
||
|
|
const vueOptions = await get("vue") || {};
|
||
|
|
return Boolean(((_vueOptions$script = vueOptions.script) === null || _vueOptions$script === void 0 ? void 0 : _vueOptions$script.propsDestructure) ?? vueOptions.propsDestructure);
|
||
|
|
} } }
|
||
|
|
},
|
||
|
|
vueJsx: { $resolve: async (val, get) => {
|
||
|
|
var _await$get$compilerOp2;
|
||
|
|
const options = val && typeof val === "object" ? val : {};
|
||
|
|
return {
|
||
|
|
isCustomElement: (_await$get$compilerOp2 = (await get("vue")).compilerOptions) === null || _await$get$compilerOp2 === void 0 ? void 0 : _await$get$compilerOp2.isCustomElement,
|
||
|
|
defineComponentName: [.../* @__PURE__ */ new Set([...options.defineComponentName ?? ["defineComponent"], "defineNuxtComponent"])],
|
||
|
|
...options
|
||
|
|
};
|
||
|
|
} },
|
||
|
|
optimizeDeps: { exclude: { $resolve: (val) => [...Array.isArray(val) ? val : [], "vue-demi"] } },
|
||
|
|
clearScreen: true,
|
||
|
|
build: {
|
||
|
|
assetsDir: { $resolve: async (val, get) => {
|
||
|
|
var _await$get$buildAsset;
|
||
|
|
return typeof val === "string" ? val : (_await$get$buildAsset = (await get("app")).buildAssetsDir) === null || _await$get$buildAsset === void 0 ? void 0 : _await$get$buildAsset.replace(/^\/+/, "");
|
||
|
|
} },
|
||
|
|
emptyOutDir: false
|
||
|
|
},
|
||
|
|
server: { fs: { allow: { $resolve: async (val, get) => {
|
||
|
|
const [buildDir, srcDir, rootDir, workspaceDir] = await Promise.all([
|
||
|
|
get("buildDir"),
|
||
|
|
get("srcDir"),
|
||
|
|
get("rootDir"),
|
||
|
|
get("workspaceDir")
|
||
|
|
]);
|
||
|
|
return [.../* @__PURE__ */ new Set([
|
||
|
|
buildDir,
|
||
|
|
srcDir,
|
||
|
|
rootDir,
|
||
|
|
workspaceDir,
|
||
|
|
...Array.isArray(val) ? val : []
|
||
|
|
])];
|
||
|
|
} } } },
|
||
|
|
cacheDir: { $resolve: async (val, get) => {
|
||
|
|
if (typeof val === "string") return val;
|
||
|
|
const rootDir = await get("rootDir");
|
||
|
|
if (existsSync(resolve(rootDir, "node_modules"))) return resolve(rootDir, "node_modules/.cache/vite");
|
||
|
|
const workspaceDir = await get("workspaceDir");
|
||
|
|
const relativeRoot = relative(workspaceDir, rootDir);
|
||
|
|
if (!relativeRoot || relativeRoot.startsWith("..")) return resolve(rootDir, "node_modules/.cache/vite");
|
||
|
|
return resolve(workspaceDir, "node_modules/.cache/vite", relativeRoot);
|
||
|
|
} }
|
||
|
|
} });
|
||
|
|
// src/config/webpack.ts
|
||
|
|
var webpack_default = defineResolvers({ webpack: {
|
||
|
|
analyze: { $resolve: async (val, get) => {
|
||
|
|
return defu(typeof val === "boolean" ? { enabled: val } : val && typeof val === "object" ? val : {}, await get("build.analyze"));
|
||
|
|
} },
|
||
|
|
profile: process.argv.includes("--profile"),
|
||
|
|
extractCSS: true,
|
||
|
|
cssSourceMap: { $resolve: (val, get) => typeof val === "boolean" ? val : get("dev") },
|
||
|
|
serverURLPolyfill: "url",
|
||
|
|
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]"
|
||
|
|
},
|
||
|
|
loaders: {
|
||
|
|
$resolve: async (val, get) => {
|
||
|
|
const loaders = val && typeof val === "object" ? val : {};
|
||
|
|
for (const name of [
|
||
|
|
"css",
|
||
|
|
"cssModules",
|
||
|
|
"less",
|
||
|
|
"sass",
|
||
|
|
"scss",
|
||
|
|
"stylus",
|
||
|
|
"vueStyle"
|
||
|
|
]) {
|
||
|
|
const loader = loaders[name];
|
||
|
|
if (loader && loader.sourceMap === void 0) loader.sourceMap = Boolean(await get("build.cssSourceMap"));
|
||
|
|
}
|
||
|
|
return loaders;
|
||
|
|
},
|
||
|
|
esbuild: { $resolve: async (val, get) => {
|
||
|
|
return defu(val && typeof val === "object" ? val : {}, await get("esbuild.options"));
|
||
|
|
} },
|
||
|
|
file: {
|
||
|
|
esModule: false,
|
||
|
|
limit: 1e3
|
||
|
|
},
|
||
|
|
fontUrl: {
|
||
|
|
esModule: false,
|
||
|
|
limit: 1e3
|
||
|
|
},
|
||
|
|
imgUrl: {
|
||
|
|
esModule: false,
|
||
|
|
limit: 1e3
|
||
|
|
},
|
||
|
|
pugPlain: {},
|
||
|
|
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]" }
|
||
|
|
},
|
||
|
|
less: {},
|
||
|
|
sass: { sassOptions: { indentedSyntax: true } },
|
||
|
|
scss: {},
|
||
|
|
stylus: {},
|
||
|
|
vueStyle: {}
|
||
|
|
},
|
||
|
|
plugins: [],
|
||
|
|
aggressiveCodeRemoval: false,
|
||
|
|
optimizeCSS: { $resolve: async (val, get) => {
|
||
|
|
if (val === false || val && typeof val === "object") return val;
|
||
|
|
return await get("build.extractCSS") ? {} : false;
|
||
|
|
} },
|
||
|
|
optimization: {
|
||
|
|
runtimeChunk: "single",
|
||
|
|
minimize: { $resolve: async (val, get) => typeof val === "boolean" ? val : !await get("dev") },
|
||
|
|
minimizer: void 0,
|
||
|
|
splitChunks: {
|
||
|
|
chunks: "all",
|
||
|
|
automaticNameDelimiter: "/",
|
||
|
|
cacheGroups: {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
postcss: { postcssOptions: { plugins: { $resolve: (val, get) => val && typeof val === "object" ? val : get("postcss.plugins") } } },
|
||
|
|
devMiddleware: { stats: "none" },
|
||
|
|
hotMiddleware: {},
|
||
|
|
friendlyErrors: true,
|
||
|
|
warningIgnoreFilters: [],
|
||
|
|
experiments: {}
|
||
|
|
} });
|
||
|
|
// src/config/index.ts
|
||
|
|
var config_default = {
|
||
|
|
...adhoc_default,
|
||
|
|
...app_default,
|
||
|
|
...build_default,
|
||
|
|
...common_default,
|
||
|
|
...dev_default,
|
||
|
|
...experimental_default,
|
||
|
|
...generate_default,
|
||
|
|
...internal_default,
|
||
|
|
...nitro_default,
|
||
|
|
...postcss_default,
|
||
|
|
...router_default,
|
||
|
|
...typescript_default,
|
||
|
|
...esbuild_default,
|
||
|
|
...oxc_default,
|
||
|
|
...vite_default,
|
||
|
|
...webpack_default
|
||
|
|
};
|
||
|
|
export { config_default as NuxtConfigSchema };
|