deno.land / x / fresh@1.1.1 / tests / fixture_plugin / utils / js-inject-plugin.ts

js-inject-plugin.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Plugin } from "$fresh/server.ts";
export default { name: "js-inject", entrypoints: { "main": new URL("./js-inject-main.ts", import.meta.url).href, }, render(ctx) { const res = ctx.render(); if (res.requiresHydration) { return { scripts: [{ entrypoint: "main", state: "JS injected!" }] }; } return {}; },} as Plugin;
fresh

Version Info

Tagged at
2 years ago