feat(server): add safety checks during dev (#1489)

Co-authored-by: Reed von Redwitz <reed+github@vonredwitz.com>
This commit is contained in:
Michael Herzner
2023-07-31 11:48:26 +02:00
committed by GitHub
co-authored by Reed von Redwitz
parent 430be774e2
commit a7fe9d04f1
20 changed files with 398 additions and 18 deletions
@@ -0,0 +1,11 @@
import { Plugin } from "$fresh/server.ts";
export default function notCallingCtxRender(): Plugin {
return {
name: "not_calling_ctx_render",
entrypoints: {},
render() {
return {};
},
};
}
@@ -0,0 +1,15 @@
import { Plugin } from "$fresh/server.ts";
export default function notHavingModules(): Plugin {
return {
name: "not_having_modules",
entrypoints: { "main": "() => {}" },
render(ctx) {
ctx.render();
return {
scripts: [{ entrypoint: "main", state: [] }],
};
},
};
}