From f238c07a11d61537124b505e60b19bf69ee519e0 Mon Sep 17 00:00:00 2001 From: Katsuhiro Ueno Date: Tue, 6 Aug 2024 12:18:13 +0900 Subject: [PATCH] feat: declare the type of ?render&doctype and ?hyderate&render --- packages/vite-plugin-minissg/client.d.ts | 10 ++++++++++ template/preact/vite.config.js | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/vite-plugin-minissg/client.d.ts b/packages/vite-plugin-minissg/client.d.ts index c3e2ea9..b9aa520 100644 --- a/packages/vite-plugin-minissg/client.d.ts +++ b/packages/vite-plugin-minissg/client.d.ts @@ -14,6 +14,11 @@ declare module '*?doctype' { export default content } +declare module '*?render&doctype' { + const content: PromiseLike + export default content +} + declare module '*?client' { const data: Record export default data @@ -23,3 +28,8 @@ declare module '*?hydrate' { const component: any export default component } + +declare module '*?hydrate&render' { + const data: Record + export default data +} diff --git a/template/preact/vite.config.js b/template/preact/vite.config.js index f64b867..52cf2f7 100644 --- a/template/preact/vite.config.js +++ b/template/preact/vite.config.js @@ -6,7 +6,10 @@ import minissgPreact from '@minissg/render-preact' export default defineConfig({ build: { rollupOptions: { - input: ['./src/index.html.jsx?render', './src/browser.html.jsx?render'] + input: [ + './src/index.html.jsx?render&doctype', + './src/browser.html.jsx?render&doctype' + ] } }, plugins: [