fix: serve internal JS from path containing build ID (#2753)

Previously imported chunks were not cached at all. They are now cached
properly with immutable cache headers.
This commit is contained in:
Luca Casonato
2024-11-08 11:44:15 +01:00
committed by GitHub
parent 96e520a352
commit 6b685dde9f
6 changed files with 42 additions and 27 deletions
+10 -1
View File
@@ -3,6 +3,7 @@ import * as path from "@std/path";
import { Builder } from "./builder.ts";
import { App } from "../app.ts";
import { RemoteIsland } from "@marvinh-test/fresh-island";
import { BUILD_ID } from "../runtime/build_id.ts";
Deno.test({
name: "Builder - chain onTransformStaticFile",
@@ -114,7 +115,15 @@ Deno.test({
await builder.build(app);
const code = await Deno.readTextFile(
path.join(tmp, "dist", "static", "RemoteIsland.js"),
path.join(
tmp,
"dist",
"static",
"_fresh",
"js",
BUILD_ID,
"RemoteIsland.js",
),
);
expect(code).toContain('"remote-island"');
},