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:
+10
-1
@@ -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"');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user