1306 lines
71 KiB
JavaScript
1306 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=requestAnimationFrame(B),_=e,R&&(R=!1,C+=e-M,b=-1/0,L=(e-C)/1e3),e-b<33)||!s||!l||!d)return;b=e;let o=(e-C)/1e3,a=Math.min(Math.max(o-L,0),.05);L=o,x=n(x,h??x,a,.22),E+=(+!!h-E)*(1-Math.exp(-a/.35));for(let e=0;e<y.length;e++)y[e]<0||(y[e]+=a*t,y[e]>=1&&(y[e]=-1));k>=0&&(k+=a*t,k>=1&&(k=-1)),s.uniform2f(d.uLogoCentre,w[0],w[1]),s.uniform2f(d.uLogoScale,g[0],g[1]),s.uniform2f(d.uResolution,m,v),s.uniform2f(d.uPointer,x[0],x[1]),s.uniform1fv(d.uWave,y),s.uniform1f(d.uHoverWave,k),s.uniform2f(d.uMisc,o,E),s.uniform2f(d.uSeason,O,z),s.uniform1f(d.uLight,z);let i=+(z>0);s.clearColor(i,i,i,1),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLES,0,O>0?1111440:1098240),A||(A=!0,G.onFirstFrame?.(),P&&X(!0)),N&&(cancelAnimationFrame(p),p=0)},V=()=>{u||(u=!0,p&&cancelAnimationFrame(p),p=0,c?.disconnect(),window.removeEventListener(\"pointermove\",H),document.documentElement.removeEventListener(\"pointerleave\",D),i?.removeEventListener(\"click\",U),i?.removeEventListener(\"pointerenter\",K),T.removeEventListener(\"change\",F),o.removeEventListener(\"webglcontextlost\",Z),s&&l&&s.deleteProgram(l),s=void 0,l=void 0)},Y=(e,t,n)=>{let o=e.createShader(t);if(!o)throw Error(\"Could not create shader.\");if(e.shaderSource(o,n),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(o);throw e.deleteShader(o),Error(`Shader failed to compile: ${t}`)}return o};try{(()=>{let t=o.getContext(\"webgl2\",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:\"low-power\"});if(!t)throw Error(\"No WebGL2 context.\");let n=t.getExtension(\"WEBGL_debug_renderer_info\"),r=String(n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL)||t.getParameter(t.RENDERER)||\"\");if(e.test(r))throw Error(`Software renderer (${r}); falling back to the lockup.`);s=t;let h=Y(t,t.VERTEX_SHADER,\"#version 300 es\\n// A particle mountain range for the dev-server loading screen.\\n//\\n// One draw call and no vertex buffers: every particle is a quad whose position\\n// is derived from gl_VertexID, sampled from a ridged heightfield in\\n// perspective, so the field reads as a range of peaks seen at a grazing angle.\\n// Nothing here depends on build progress — the screen looks the same at one\\n// second and at two minutes.\\n//\\n// Motion, all continuous loops:\\n// · per-particle drift and shimmer\\n// · slow luminosity waves crossing the field\\n// · a ripple radiating from the lockup\\n// · overlapping shockwaves fired by clicking the lockup\\nprecision highp float;\\n\\nuniform vec2 uLogoCentre;\\nuniform vec2 uLogoScale;\\nuniform vec2 uResolution;\\n/** pointer position in canvas space, smoothed */\\nuniform vec2 uPointer;\\n/** shockwave phases 0..1; negative entries are inactive */\\nuniform float uWave[8];\\n/** subtle pointer-enter wave phase; negative while inactive */\\nuniform float uHoverWave;\\n/** x: seconds, y: pointer presence 0..1 */\\nuniform vec2 uMisc;\\n/** x: winter 0..1 — snow on the peaks and falling flakes; y: 1 in light mode */\\nuniform vec2 uSeason;\\n\\nout vec2 vLocal;\\n/** dark: emitted colour, w unused. light: ink colour, w its coverage. */\\nout vec4 vTint;\\n\\nconst vec3 MINT = vec3(0.0, 0.8627451, 0.5098039);\\nconst vec3 MINT_PALE = vec3(0.6235294, 1.0, 0.8156863);\\nconst vec3 SNOW = vec3(0.88, 1.0, 0.96);\\n\\n// Light mode draws the same range as ink on paper. Emitted light becomes\\n// coverage, and the renderer blends it over the page instead of adding it to\\n// the dark. Alpha rather than subtraction, so a crest that many particles\\n// land on settles on the brand green instead of running away to black.\\nconst vec3 INK = vec3(0.0);\\nconst vec3 LUMA = vec3(0.2126, 0.7152, 0.0722);\\n\\n// grid of particles\\nconst uint COLS = 704u;\\nconst uint ROWS = 260u;\\nconst uint TERRAIN_COUNT = COLS * ROWS;\\n\\n// camera\\nconst float Z_NEAR = 1.3;\\nconst float Z_FAR = 26.0;\\nconst float CAM_Y = 2.4;\\nconst float FOCAL = 1.3;\\nconst float HORIZON = 0.30;\\n// Narrower windows get this view scaled down to fit their width, rather than\\n// the full-height scene squeezed sideways.\\nconst float MIN_VIEW_ASPECT = 0.95;\\n/** how far the fitted scene rises, so the peaks clear the icon */\\nconst float FIT_LIFT = 0.35;\\n\\n// the two summits that shape the skyline, in screen-x units\\nconst float PEAK1_X = -0.40;\\nconst float PEAK1_H = 3.2;\\nconst float PEAK2_X = 0.40;\\nconst float PEAK2_H = 2.2;\\n\\nconst vec2 QUAD[6] = vec2[6](\\n vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0),\\n vec2(-1.0, 1.0), vec2(1.0, -1.0), vec2(1.0, 1.0)\\n);\\n\\nfloat hash21 (vec2 p) {\\n vec2 q = fract(p * vec2(0.1031, 0.1030));\\n q += dot(q, q.yx + 33.33);\\n return fract((q.x + q.y) * q.x);\\n}\\n\\nfloat noise2 (vec2 p) {\\n vec2 i = floor(p);\\n vec2 f = fract(p);\\n vec2 u = f * f * (3.0 - 2.0 * f);\\n float a = hash21(i);\\n float b = hash21(i + vec2(1.0, 0.0));\\n float c = hash21(i + vec2(0.0, 1.0));\\n float d = hash21(i + vec2(1.0, 1.0));\\n return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\\n}\\n\\nfloat shockwave (float phase, float dist) {\\n if (phase < 0.0) { return 0.0; }\\n float radius = phase * 1.7;\\n float width = 0.09 + phase * 0.20;\\n return exp(-((dist - radius) * (dist - radius)) / (width * width))\\n * (1.0 - smoothstep(0.55, 1.0, phase))\\n * smoothstep(0.0, 0.04, phase);\\n}\\n\\n// `shape` flattens the relief on narrow screens. A summit covers the same\\n// fraction of screen height whatever the aspect, but far fewer pixels of width\\n// in portrait, so without this the peaks turn into needles.\\nfloat terrain (float x, float z, float u, float shape) {\\n // ridged noise stretched along the view axis gives crest lines that flow\\n // into the distance rather than a lumpy field\\n vec2 q = vec2(x * 0.30, z * 0.085);\\n float r = 0.0;\\n float amp = 0.55;\\n mat2 rot = mat2(1.6, 1.2, -1.2, 1.6);\\n for (int i = 0; i < 5; i++) {\\n r += amp * (1.0 - abs(2.0 * noise2(q) - 1.0));\\n q = rot * q;\\n amp *= 0.55;\\n }\\n float h = pow(max(r, 0.0), 1.5) * 2.6;\\n h *= 0.70 + 0.60 * noise2(vec2(x * 0.05, z * 0.05) + 7.0);\\n // two designed summits, far enough back to break the horizon\\n float rise = smoothstep(3.0, 9.0, z);\\n h += rise * PEAK1_H * max(0.0, 1.0 - abs(u - PEAK1_X) * 3.2);\\n h += rise * PEAK2_H * max(0.0, 1.0 - abs(u - PEAK2_X) * 3.6);\\n return max(h, 0.0) * shape;\\n}\\n\\nvoid main () {\\n uint id = uint(gl_VertexID) / 6u;\\n int corner = gl_VertexID % 6;\\n float t = uMisc.x;\\n vec2 resolution = max(uResolution, vec2(1.0));\\n float aspect = max(resolution.x / resolution.y, 0.25);\\n float winter = uSeason.x;\\n float light = uSeason.y;\\n\\n // the icon centre is needed by both the terrain and the flakes\\n float logoH = max(uLogoScale.y, 0.01);\\n vec2 centre = vec2(\\n uLogoCentre.x * 2.0 - 1.0,\\n 1.0 - 2.0 * uLogoCentre.y\\n );\\n vec2 offset = QUAD[corner];\\n\\n // A flake drifting down the screen, in its own parallax layer. Independent of\\n // the terrain: it lives in screen space and wraps around forever. Flakes are\\n // drawn from the indices past the terrain, so winter costs nothing out of\\n // season — the draw call is simply shorter.\\n if (id >= TERRAIN_COUNT) {\\n float fi = float(id - TERRAIN_COUNT);\\n float r1 = hash21(vec2(fi, 1.7));\\n float r2 = hash21(vec2(fi, 5.3));\\n float r3 = hash21(vec2(fi, 9.1));\\n // near flakes are bigger, brighter and fall faster\\n float depth = 0.30 + r3 * 0.70;\\n float x = (r1 * 2.4 - 1.2) + sin(t * (0.25 + r2 * 0.35) + r1 * 40.0) * 0.05 * depth;\\n float y = 1.2 - fract(r2 + t * (0.020 + r3 * 0.035)) * 2.5;\\n vec2 pos = vec2(x, y);\\n\\n // flakes thin out over the icon so they never sit on the mark\\n vec2 toCentre = vec2((pos.x - centre.x) * aspect, pos.y - centre.y);\\n vec2 clear = abs(toCentre / vec2(logoH * 3.4, logoH * 2.8));\\n float clearing = 0.25 + 0.75 * smoothstep(0.5, 1.2, pow(pow(clear.x, 3.0) + pow(clear.y, 3.0), 1.0 / 3.0));\\n float twinkle = 0.75 + 0.25 * sin(t * (1.1 + r1 * 2.0) + r2 * 30.0);\\n float sizePx = (0.55 + depth * 1.5) * (resolution.y / 900.0);\\n float amount = (0.16 + 0.48 * depth) * twinkle * clearing * winter;\\n\\n gl_Position = vec4(pos + offset * sizePx * 2.0 / resolution, 0.5, 1.0);\\n vLocal = offset;\\n // white flakes cannot show on paper, so light mode draws them as ink\\n vTint = light > 0.5 ? vec4(INK, amount * 1.6) : vec4(SNOW * amount, 1.0);\\n return;\\n }\\n\\n uint col = id % COLS;\\n uint row = id / COLS;\\n vec2 seed = vec2(float(col), float(row));\\n float jitterX = hash21(seed) - 0.5;\\n float jitterY = hash21(seed + 17.0) - 0.5;\\n float rnd = hash21(seed + 41.0);\\n\\n // screen-x is fixed per column; depth is biased so the near field is denser\\n float u = ((float(col) + jitterX) / float(COLS)) * 2.3 - 1.15;\\n float v = clamp((float(row) + jitterY) / float(ROWS), 0.0, 1.0);\\n float z = mix(Z_NEAR, Z_FAR, pow(v, 1.5));\\n // widen the field of view and flatten the range as the window narrows, so a\\n // phone shows a range rather than a row of spikes\\n float view = max(aspect, MIN_VIEW_ASPECT);\\n float shape = clamp(view / 1.6, 0.5, 1.0);\\n float tanX = view / FOCAL;\\n // below the minimum aspect the vertical shrinks with the horizontal, so the\\n // range keeps its proportions instead of stretching down a tall screen\\n float fit = aspect / view;\\n float lift = (1.0 - fit) * FIT_LIFT;\\n float xw = u * z * tanX;\\n\\n float h = terrain(xw, z, u, shape);\\n h += (noise2(vec2(xw * 1.6, z * 1.6)) - 0.5) * 0.05 * shape;\\n\\n // shading from the surface itself: one fixed light, plus a convexity term\\n // that picks out the crests\\n float e = 0.22;\\n float hxp = terrain(xw + e, z, u, shape);\\n float hxm = terrain(xw - e, z, u, shape);\\n float hzp = terrain(xw, z + e, u, shape);\\n vec3 normal = normalize(vec3(-(hxp - hxm) / (2.0 * e), 1.0, -(hzp - h) / e));\\n vec3 lightDir = normalize(vec3(-0.12, 0.60, -0.42));\\n float diffuse = pow(max(dot(normal, lightDir), 0.0), 1.3);\\n float crest = smoothstep(0.0, 1.5, (2.0 * h - hxp - hxm) / (e * e) * 0.2);\\n\\n float sy = ((h - CAM_Y) / z * FOCAL + HORIZON) * fit + lift;\\n\\n // nearer ridges hide what lies behind them, which is what makes the skyline\\n float occluded = 0.0;\\n for (int k = 1; k <= 4; k++) {\\n float zs = Z_NEAR + (z - Z_NEAR) * float(k) / 5.0;\\n float hs = terrain(u * zs * tanX, zs, u, shape);\\n occluded = max(occluded, step(sy + 0.012 * fit, ((hs - CAM_Y) / zs * FOCAL + HORIZON) * fit + lift));\\n }\\n\\n // the icon sits in a tight clearing so it always reads on plain ground.\\n // Waves and ripples are measured from this same point, so they leave the mark.\\n vec2 toCentre = vec2((u - centre.x) * aspect, sy - centre.y);\\n float dist = length(toCentre);\\n // The clearing has to read as haze, not as a hole cut out of the scene, so it\\n // fades over a short distance and its edge is broken up by noise. A squircle\\n // around the icon, not the old icon+wordmark block.\\n vec2 clear = abs(toCentre / vec2(logoH * 3.6, logoH * 3.0));\\n float clearEdge = pow(pow(clear.x, 3.0) + pow(clear.y, 3.0), 1.0 / 3.0)\\n + (noise2(vec2(xw * 0.55, z * 0.55)) - 0.5) * 0.30;\\n float clearing = smoothstep(0.46, 1.30, clearEdge);\\n\\n // ambient ripple, always running\\n float ripplePhase = fract(t * 0.30);\\n float rippleRadius = ripplePhase * 2.4;\\n float rippleWidth = 0.16 + ripplePhase * 0.25;\\n float ripple = exp(-((dist - rippleRadius) * (dist - rippleRadius)) / (rippleWidth * rippleWidth))\\n * (1.0 - smoothstep(0.55, 0.95, ripplePhase))\\n * smoothstep(0.0, 0.05, ripplePhase);\\n\\n // Every click has an independent phase, so its ring keeps travelling even\\n // when another click starts a new one.\\n float shock = 0.0;\\n for (int i = 0; i < 8; i++) {\\n shock += shockwave(uWave[i], dist);\\n }\\n shock += shockwave(uHoverWave, dist) * 0.25;\\n\\n float fog = exp(-(z - Z_NEAR) * 0.075) * (1.0 - smoothstep(0.86, 1.0, v));\\n float nearFade = smoothstep(Z_NEAR, 2.6, z);\\n // in winter the snowline drops a long way and the caps turn properly white\\n float snowline = 2.6 - winter * 1.7;\\n float snow = smoothstep(snowline, snowline + 1.0 - winter * 0.45, h);\\n float shimmer = 0.88 + 0.12 * sin(t * (0.7 + rnd * 1.4) + rnd * 31.0);\\n float grain = 0.88 + 0.24 * noise2(vec2(xw * 3.0, z * 3.0));\\n\\n // a fifth of the particles pulse on their own cycle, so the field never\\n // settles into a repeating pattern\\n float pulses = step(0.82, hash21(seed + 63.0));\\n float pulse = pow(0.5 + 0.5 * sin(t * (0.5 + rnd * 1.1) + rnd * 61.0), 6.0);\\n\\n // two slow noise waves drifting across the field\\n float waveA = noise2(vec2(xw * 0.22 - t * 0.20, z * 0.22)) - 0.5;\\n float waveB = noise2(vec2(xw * 0.55 + t * 0.09, z * 0.55 - t * 0.14)) - 0.5;\\n float wave = 1.0 + waveA * 0.24 + waveB * 0.16;\\n\\n // snow throws light back, so the caps read brighter as well as whiter\\n float lit = diffuse * 0.18 + crest * (0.34 + diffuse * 0.45) + snow * (0.06 + winter * 0.30);\\n // The fitted range packs the same dust into a smaller area, so overlapping\\n // particles add up faster: the base is dimmed and the highlights calmed, or\\n // pulses and shockwaves blow out to white.\\n float brightness = (0.008 + lit * grain)\\n * fog * nearFade * wave * shimmer\\n * (1.0 + pulse * (0.18 + pulses * 1.1) * fit)\\n * (1.0 + (ripple * 0.75 + shock * 3.0) * fit)\\n * sqrt(fit);\\n vec3 tint = mix(MINT * 0.75, MINT_PALE, clamp(crest + snow * 0.5, 0.0, 1.0));\\n tint = mix(tint, SNOW, winter * snow) * brightness;\\n\\n // faded with the near ground too, or stray glints read as falling snow\\n float glint = step(0.993, rnd) * diffuse * (0.5 + 0.5 * sin(t * 2.0 + rnd * 47.0)) * nearFade;\\n tint += vec3(0.85, 1.0, 0.93) * glint * fog * 0.55;\\n\\n // the pointer stirs nearby dust\\n vec2 pointer = vec2((uPointer.x - 0.5) * 2.0, (0.5 - uPointer.y) * 2.0);\\n vec2 toPointer = vec2((u - pointer.x) * aspect, sy - pointer.y);\\n float excite = (1.0 - smoothstep(0.0, 0.55, length(toPointer))) * uMisc.y;\\n vec2 push = normalize(toPointer + vec2(0.0001, 0.0)) * excite * (0.006 + 0.010 * rnd);\\n tint *= 1.0 + excite * 1.3;\\n\\n // Light mode reuses every lighting term above and only reinterprets it: how\\n // much light a particle emits becomes how much ink it lays down. Taking the\\n // luminance keeps the two themes at matching density, and the crests that go\\n // palest on black carry the brand green on paper. Snow is the one term that\\n // has to invert — a white cap can only read on paper by leaving it bare.\\n if (light > 0.5) {\\n // lifted, since faint dust that reads fine against black all but vanishes\\n // against white\\n float coverage = pow(clamp(dot(tint, LUMA) * 2.2, 0.0, 1.0), 0.8) * (1.0 - winter * snow * 0.6);\\n vTint = vec4(INK, coverage * (1.0 - occluded) * clearing);\\n } else {\\n vTint = vec4(tint * (1.0 - occluded) * clearing, 1.0);\\n }\\n\\n // particles float around their anchor, more freely up close\\n float floatAmp = (0.0015 + (1.0 - v) * 0.006) * (1.0 + excite * 2.5);\\n vec2 drift = vec2(\\n sin(t * (0.35 + rnd * 0.5) + rnd * 40.0),\\n cos(t * (0.28 + rnd * 0.45) + rnd * 23.0) * 1.4\\n ) * floatAmp;\\n\\n // the shockwave shoves particles outward as it passes\\n vec2 shockPush = vec2(toCentre.x / max(dist, 0.02) / aspect, toCentre.y / max(dist, 0.02)) * shock * 0.045;\\n\\n float sizePx = clamp(16.0 / z, 0.65, 1.9)\\n * (0.75 + 0.5 * hash21(seed + 27.0))\\n * (1.0 + glint * 0.25 + (ripple * 0.20 + shock * 0.75) * fit);\\n\\n gl_Position = vec4(\\n vec2(u, sy) + (drift + push + shockPush) * fit + offset * sizePx * 2.0 / resolution,\\n 0.5,\\n 1.0\\n );\\n vLocal = offset;\\n}\\n\"),f=Y(t,t.FRAGMENT_SHADER,\"#version 300 es\\nprecision highp float;\\n\\nin vec2 vLocal;\\nin vec4 vTint;\\n/** 1 in light mode; uniform across the draw, so the branch is free */\\nuniform float uLight;\\nout vec4 fragColor;\\n\\nvoid main () {\\n float falloff = 1.0 - smoothstep(0.45, 1.0, length(vLocal));\\n if (uLight > 0.5) {\\n // premultiplied, so it composites over the page and settles on the ink\\n // colour however much dust lands on it\\n float alpha = vTint.a * falloff;\\n fragColor = vec4(vTint.rgb * alpha, alpha);\\n } else {\\n fragColor = vec4(vTint.rgb * falloff, 1.0);\\n }\\n}\\n\"),u=t.createProgram();if(!u)throw Error(\"Could not create program.\");if(t.attachShader(u,h),t.attachShader(u,f),t.linkProgram(u),t.deleteShader(h),t.deleteShader(f),!t.getProgramParameter(u,t.LINK_STATUS)){let e=t.getProgramInfoLog(u);throw t.deleteProgram(u),Error(`Program failed to link: ${e}`)}l=u,t.useProgram(u);let m=e=>t.getUniformLocation(u,e);d={uLogoCentre:m(\"uLogoCentre\"),uLogoScale:m(\"uLogoScale\"),uResolution:m(\"uResolution\"),uPointer:m(\"uPointer\"),uWave:m(\"uWave[0]\"),uHoverWave:m(\"uHoverWave\"),uMisc:m(\"uMisc\"),uSeason:m(\"uSeason\"),uLight:m(\"uLight\")},t.bindVertexArray(t.createVertexArray()),t.disable(t.DEPTH_TEST),t.enable(t.BLEND),W(),q(),c=typeof ResizeObserver>\"u\"?void 0:new ResizeObserver(q),c?.observe(o),c?.observe(a),window.addEventListener(\"pointermove\",H),document.documentElement.addEventListener(\"pointerleave\",D),i?.addEventListener(\"click\",U),i?.addEventListener(\"pointerenter\",K),T.addEventListener(\"change\",F),o.addEventListener(\"webglcontextlost\",Z),p||=requestAnimationFrame(B)})(),f=Promise.resolve()}catch(e){V(),f=Promise.reject(e instanceof Error?e:Error(String(e)))}let G={ready:f,dispose:V,setPaused:X,setWinter:e=>{let t=+!!e;t!==O&&(O=t,I())}};return G}var a=\"nuxt-snow\";function o(){try{return\"false\"!==window.localStorage.getItem(a)}catch{return!0}}function s(e){let t=r(),n=o();if(e.setWinter(t&&n),!t)return;let i=document.querySelector(\"#nuxt-season\");if(!i)return;let s=()=>{i.style.opacity=n?\"1\":\"0.4\",i.setAttribute(\"aria-pressed\",String(n)),i.title=n?\"Turn off snow\":\"Turn on snow\"};s(),i.hidden=!1,i.addEventListener(\"click\",()=>{n=!n,e.setWinter(n),s();try{window.localStorage.setItem(a,String(n))}catch{}})}function c(){try{let e=new URLSearchParams(window.location.search).get(\"shader\");return\"0\"===e||\"false\"===e}catch{return!1}}function l(){let e=document.querySelector(\"#nuxt-shader\"),t=document.querySelector(\"#nuxt-logo-slot\");if(!e||!t||!window.WebGL2RenderingContext||c())return void e?.remove();let n=i(e,t,document.querySelector(\".nuxt-lockup\"));s(n),n.onFirstFrame=()=>{e.style.opacity=\"1\"},n.ready.catch(()=>e.remove()),window.addEventListener(\"pagehide\",()=>n.dispose(),{once:!0});let o=e=>n.setPaused(e);window===window.top?(window.addEventListener(\"blur\",()=>o(!0)),window.addEventListener(\"focus\",()=>o(!1)),document.addEventListener(\"visibilitychange\",()=>{document.hidden?o(!0):document.hasFocus()&&o(!1)}),(document.hidden||!document.hasFocus())&&o(!0)):(document.addEventListener(\"visibilitychange\",()=>o(document.hidden)),document.hidden&&o(!0))}\"loading\"===document.readyState?document.addEventListener(\"DOMContentLoaded\",l,{once:!0}):l();<\/script></head><body><canvas id=\"nuxt-shader\" aria-hidden=\"true\"></canvas> <button type=\"button\" class=\"nuxt-lockup\" id=\"nuxtImg\" aria-label=\"" + escapeHtml(messages.appName) + "\"><span id=\"nuxt-logo-slot\" class=\"nuxt-logo-slot\"> <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" aria-hidden=\"true\" viewBox=\"0 0 48 32\"><path d=\"M26.88 32h17.76c.567 0 1.11-.2 1.6-.48s.997-.633 1.28-1.12c.283-.486.48-1.038.48-1.6s-.196-1.114-.48-1.6l-12-20.64a2.9 2.9 0 0 0-1.12-1.12c-.49-.28-1.193-.48-1.76-.48s-1.11.2-1.6.48-.837.634-1.12 1.12l-3.04 5.28L20.8 1.6c-.284-.487-.63-1-1.12-1.28S18.647 0 18.08 0s-1.11.04-1.6.32-.997.793-1.28 1.28L.32 27.2c-.284.486-.32 1.038-.32 1.6 0 .561.037 1.113.32 1.6.283.486.79.84 1.28 1.12s1.033.48 1.6.48h11.2c4.438 0 7.668-1.99 9.92-5.76l5.44-9.44 2.88-4.96 8.8 15.04H29.76zm-12.64-5.12H6.4L18.08 6.72 24 16.8l-3.921 6.836c-1.496 2.446-3.201 3.244-5.839 3.244\"/></svg> </span></button> <button class=\"nuxt-season\" id=\"nuxt-season\" type=\"button\" hidden aria-pressed=\"true\" title=\"Turn off snow\"><svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.3\" aria-hidden=\"true\" viewBox=\"0 0 16 16\"><path d=\"M8 1.6v12.8M2.46 4.8l11.08 6.4m-11.08 0 11.08-6.4M6.1 3.1 8 4.2l1.9-1.1m-3.8 9.8L8 11.8l1.9 1.1\"/></svg> <span class=\"nuxt-sr\">Snow</span></button> <div class=\"nuxt-loader-bar\"></div><script>const loadingRoot=document.documentElement,loadingTitleElement=document.querySelector(\"title\"),loadingAppName=loadingTitleElement?.dataset.appName||\"Nuxt\",loadingSuffix=` | ${loadingAppName}`,updateLoadingTitle=()=>{const e=loadingRoot.style.getPropertyValue(\"--nuxt-progress\").trim(),t=e.endsWith(\"%\")?Number.parseFloat(e):Number.NaN;let i=document.title.replace(/^\\d+% \\| /,\"\");i.endsWith(loadingSuffix)&&(i=i.slice(0,-loadingSuffix.length));const n=Number.isFinite(t)?`${Math.round(Math.min(100,Math.max(0,t)))}% | `:\"\";document.title=`${n}${i}${loadingSuffix}`};\"undefined\"!=typeof MutationObserver&&(new MutationObserver(updateLoadingTitle).observe(loadingRoot,{attributes:!0,attributeFilter:[\"style\"]}),updateLoadingTitle());<\/script><script>if(!window.frameElement)if(void 0===window.fetch)setTimeout(()=>window.location.reload(),200);else{let t=200;const e=async()=>{try{if(!(await window.fetch(window.location.href,{headers:{accept:\"text/html\"}}).then(t=>t.text())).includes(\"__NUXT_LOADING__\"))return window.location.reload()}catch{}setTimeout(e,t),t=Math.min(Math.round(1.5*t),1e3)};e()}<\/script></body></html>";
|
|
};
|
|
// 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 };
|