feat: pass resolved config to plugin.buildStart() (#1961)
This commit is contained in:
@@ -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}`);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -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",
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user