| Server IP : 159.203.156.69 / Your IP : 216.73.217.172 Web Server : nginx/1.24.0 System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/tanviranik.com/node_modules/vinext/dist/build/ |
Upload File : |
{"version":3,"file":"ssr-manifest.js","names":[],"sources":["../../src/build/ssr-manifest.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { normalizeManifestFile, manifestFileWithBase } from \"../utils/manifest-paths.js\";\n\nexport type BundleBackfillChunk = {\n type: \"chunk\";\n fileName: string;\n imports?: string[];\n modules?: Record<string, unknown>;\n viteMetadata?: {\n importedCss?: Set<string>;\n importedAssets?: Set<string>;\n };\n};\n\nexport function tryRealpathSync(candidate: string): string | null {\n try {\n return fs.realpathSync.native(candidate);\n } catch {\n return null;\n }\n}\n\nfunction isWindowsAbsolutePath(candidate: string): boolean {\n return /^[a-zA-Z]:[\\\\/]/.test(candidate) || candidate.startsWith(\"\\\\\\\\\");\n}\n\nexport function relativeWithinRoot(root: string, moduleId: string): string | null {\n const useWindowsPath = isWindowsAbsolutePath(root) || isWindowsAbsolutePath(moduleId);\n const relativeId = (\n useWindowsPath ? path.win32.relative(root, moduleId) : path.relative(root, moduleId)\n ).replace(/\\\\/g, \"/\");\n // path.relative(root, root) returns \"\", which is not a usable manifest key and should be\n // treated the same as \"outside root\" for this helper.\n if (!relativeId || relativeId === \"..\" || relativeId.startsWith(\"../\")) return null;\n return relativeId;\n}\n\nfunction normalizeManifestModuleId(moduleId: string, root: string): string {\n const normalizedId = moduleId.replace(/\\\\/g, \"/\");\n if (normalizedId.startsWith(\"\\0\")) return normalizedId;\n if (normalizedId.startsWith(\"node_modules/\") || normalizedId.includes(\"/node_modules/\")) {\n return normalizedId;\n }\n\n if (!isWindowsAbsolutePath(moduleId) && !path.isAbsolute(moduleId)) {\n if (!normalizedId.startsWith(\".\") && !normalizedId.includes(\"../\")) {\n // Preserve bare specifiers like \"pages/counter.tsx\". These are already\n // stable manifest keys and resolving them against root would rewrite them\n // into filesystem paths that no longer match the bundle/module graph.\n return normalizedId;\n }\n }\n\n const rootCandidates = new Set<string>([root]);\n const realRoot = tryRealpathSync(root);\n if (realRoot) rootCandidates.add(realRoot);\n\n const moduleCandidates = new Set<string>();\n if (isWindowsAbsolutePath(moduleId) || path.isAbsolute(moduleId)) {\n moduleCandidates.add(moduleId);\n } else {\n moduleCandidates.add(path.resolve(root, moduleId));\n }\n\n for (const candidate of moduleCandidates) {\n const realCandidate = tryRealpathSync(candidate);\n // Set iteration stays live as entries are appended, so this also checks the\n // realpath variant without needing a second pass or an intermediate array.\n if (realCandidate) moduleCandidates.add(realCandidate);\n }\n\n for (const rootCandidate of rootCandidates) {\n for (const moduleCandidate of moduleCandidates) {\n const relativeId = relativeWithinRoot(rootCandidate, moduleCandidate);\n if (relativeId) return relativeId;\n }\n }\n\n return normalizedId;\n}\n\nexport function augmentSsrManifestFromBundle(\n ssrManifest: Record<string, string[]>,\n bundle: Record<string, BundleBackfillChunk | { type: string }>,\n root: string,\n base = \"/\",\n): Record<string, string[]> {\n const nextManifest = {} as Record<string, Set<string>>;\n\n for (const [key, files] of Object.entries(ssrManifest)) {\n const normalizedKey = normalizeManifestModuleId(key, root);\n if (!nextManifest[normalizedKey]) nextManifest[normalizedKey] = new Set<string>();\n for (const file of files) {\n nextManifest[normalizedKey].add(normalizeManifestFile(file));\n }\n }\n\n for (const item of Object.values(bundle)) {\n if (item.type !== \"chunk\") continue;\n const chunk = item as BundleBackfillChunk;\n\n const files = new Set<string>();\n files.add(manifestFileWithBase(chunk.fileName, base));\n for (const importedFile of chunk.imports ?? []) {\n files.add(manifestFileWithBase(importedFile, base));\n }\n for (const cssFile of chunk.viteMetadata?.importedCss ?? []) {\n files.add(manifestFileWithBase(cssFile, base));\n }\n for (const assetFile of chunk.viteMetadata?.importedAssets ?? []) {\n files.add(manifestFileWithBase(assetFile, base));\n }\n\n for (const moduleId of Object.keys(chunk.modules ?? {})) {\n const key = normalizeManifestModuleId(moduleId, root);\n if (key.startsWith(\"node_modules/\") || key.includes(\"/node_modules/\")) continue;\n if (key.startsWith(\"\\0\")) continue;\n if (!nextManifest[key]) nextManifest[key] = new Set<string>();\n for (const file of files) {\n nextManifest[key].add(file);\n }\n }\n }\n\n return Object.fromEntries(\n Object.entries(nextManifest).map(([key, files]) => [key, [...files]]),\n ) as Record<string, string[]>;\n}\n"],"mappings":";;;;AAeA,SAAgB,gBAAgB,WAAkC;CAChE,IAAI;EACF,OAAO,GAAG,aAAa,OAAO,UAAU;SAClC;EACN,OAAO;;;AAIX,SAAS,sBAAsB,WAA4B;CACzD,OAAO,kBAAkB,KAAK,UAAU,IAAI,UAAU,WAAW,OAAO;;AAG1E,SAAgB,mBAAmB,MAAc,UAAiC;CAEhF,MAAM,cADiB,sBAAsB,KAAK,IAAI,sBAAsB,SAAS,GAElE,KAAK,MAAM,SAAS,MAAM,SAAS,GAAG,KAAK,SAAS,MAAM,SAAS,EACpF,QAAQ,OAAO,IAAI;CAGrB,IAAI,CAAC,cAAc,eAAe,QAAQ,WAAW,WAAW,MAAM,EAAE,OAAO;CAC/E,OAAO;;AAGT,SAAS,0BAA0B,UAAkB,MAAsB;CACzE,MAAM,eAAe,SAAS,QAAQ,OAAO,IAAI;CACjD,IAAI,aAAa,WAAW,KAAK,EAAE,OAAO;CAC1C,IAAI,aAAa,WAAW,gBAAgB,IAAI,aAAa,SAAS,iBAAiB,EACrF,OAAO;CAGT,IAAI,CAAC,sBAAsB,SAAS,IAAI,CAAC,KAAK,WAAW,SAAS;MAC5D,CAAC,aAAa,WAAW,IAAI,IAAI,CAAC,aAAa,SAAS,MAAM,EAIhE,OAAO;;CAIX,MAAM,iBAAiB,IAAI,IAAY,CAAC,KAAK,CAAC;CA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