fix: don't fallthrough static files in dev (#2156)

This commit is contained in:
Marvin Hagemeister
2023-12-07 12:23:23 +01:00
committed by GitHub
parent 90b0642bdd
commit 498aa8c463
10 changed files with 173 additions and 2 deletions
+9 -2
View File
@@ -296,8 +296,15 @@ export async function extractRoutes(
const staticFiles: StaticFile[] = [];
try {
const outDirStatic = join(config.build.outDir, "static");
for (const staticDir of [config.staticDir, outDirStatic]) {
const staticDirs = [config.staticDir];
// Only fall through to files in /_fresh/static when not in dev
if (state.loadSnapshot) {
const outDirStatic = join(config.build.outDir, "static");
staticDirs.push(outDirStatic);
}
for (const staticDir of staticDirs) {
const staticDirUrl = toFileUrl(staticDir);
const entries = walk(staticDir, {
includeFiles: true,