feat: scaffold Astro + Tailwind project

This commit is contained in:
TerryM
2026-05-12 16:16:03 +08:00
parent 906eb5c763
commit 03d3800c6c
12097 changed files with 1266600 additions and 0 deletions

28
node_modules/astro/dist/vite-plugin-astro/utils.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import fs from "node:fs/promises";
const frontmatterRE = /^---(.*?)^---/ms;
const RETURN_REPLACE_RE = /(\/\/[^\n]*|\/\*[\s\S]*?\*\/|`(?:[^`\\]|\\.)*`|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')|(?<!\.)\breturn(\s*;|\b)/g;
function replaceTopLevelReturns(code) {
return code.replace(RETURN_REPLACE_RE, (_match, skip, tail) => {
if (skip !== void 0) return skip;
return tail.trim() === ";" ? "throw 0;" : "throw ";
});
}
async function loadId(pluginContainer, id) {
const result = await pluginContainer.load(id, { ssr: true });
if (result) {
if (typeof result === "string") {
return result;
} else {
return result.code;
}
}
try {
return await fs.readFile(id, "utf-8");
} catch {
}
}
export {
frontmatterRE,
loadId,
replaceTopLevelReturns
};