feat: expose config in context + simplify page props (#2102)

This commit is contained in:
Marvin Hagemeister
2023-11-30 16:11:31 +01:00
committed by GitHub
parent aafe048243
commit 9e11c5c56b
11 changed files with 254 additions and 123 deletions
+25 -23
View File
@@ -19,29 +19,10 @@ const mainEntry = toFileUrl(join(
"client.ts",
)).href;
Deno.test("esbuild snapshot with cwd=Deno.cwd()", async () => {
const builder = new EsbuildBuilder({
absoluteWorkingDir: Deno.cwd(),
buildID: "foo",
configPath: denoJson,
dev: false,
entrypoints: {
main: mainEntry,
},
jsx: "react-jsx",
target: "es2020",
});
const snapshot = await builder.build();
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
});
Deno.test({
name: "esbuild snapshot with cwd=/",
ignore: Deno.build.os === "windows",
fn: async () => {
Deno.test("esbuild", async (t) => {
await t.step("esbuild snapshot with cwd=Deno.cwd()", async () => {
const builder = new EsbuildBuilder({
absoluteWorkingDir: "/",
absoluteWorkingDir: Deno.cwd(),
buildID: "foo",
configPath: denoJson,
dev: false,
@@ -54,5 +35,26 @@ Deno.test({
const snapshot = await builder.build();
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
},
});
await t.step({
name: "esbuild snapshot with cwd=/",
ignore: Deno.build.os === "windows",
fn: async () => {
const builder = new EsbuildBuilder({
absoluteWorkingDir: "/",
buildID: "foo",
configPath: denoJson,
dev: false,
entrypoints: {
main: mainEntry,
},
jsx: "react-jsx",
target: "es2020",
});
const snapshot = await builder.build();
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
},
});
});