From 72da42f96ac275885c9e89c71a8f703f9c936574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 12 Oct 2023 23:02:31 -0400 Subject: [PATCH] refactor(client-side): add plugin to automatically inject ant design styles into html --- plugins/ssrStyles.tsx | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 plugins/ssrStyles.tsx diff --git a/plugins/ssrStyles.tsx b/plugins/ssrStyles.tsx new file mode 100644 index 0000000..09c0827 --- /dev/null +++ b/plugins/ssrStyles.tsx @@ -0,0 +1,42 @@ +import { writeFileSync } from "fs"; +import { extractStyle } from "ant-design-vue/lib/_util/static-style-extract"; +import { ConfigProvider, theme } from "ant-design-vue"; + +const css = extractStyle((node) => ( + <> + + {node} + + + {node} + + +)); + +export default defineNitroPlugin((nitro) => { + nitro.hooks.hook("render:html", (html) => { + html.head.push(``); + }); +});