feat: pass resolved config to plugin.buildStart() (#1961)

This commit is contained in:
Marvin Hagemeister
2023-10-19 17:25:16 +02:00
committed by GitHub
parent c41cfc9227
commit cbd5b842b0
7 changed files with 85 additions and 61 deletions
@@ -1,4 +1,5 @@
import { defineConfig } from "$fresh/src/server/defines.ts";
import * as path from "https://deno.land/std@0.193.0/path/mod.ts";
export default defineConfig({
plugins: [
@@ -20,5 +21,12 @@ export default defineConfig({
console.log("Plugin b: buildStart");
},
},
{
name: "c",
buildStart(config) {
const outDir = path.relative(Deno.cwd(), config.build.outDir);
console.log(`Plugin c: ${outDir}`);
},
},
],
});
+2
View File
@@ -5,6 +5,7 @@ import {
assertEquals,
assertStringIncludes,
delay,
join,
puppeteer,
} from "./deps.ts";
import manifest from "./fixture_plugin/fresh.gen.ts";
@@ -146,6 +147,7 @@ Deno.test("calls buildStart() and buildEnd()", async () => {
assertEquals(out, [
"Plugin a: buildStart",
"Plugin b: buildStart",
`Plugin c: ${join("tests", "fixture_plugin_lifecycle", "_fresh")}`,
"Plugin a: buildEnd",
"Plugin b: buildEnd",
]);