Open MrFoxPro opened 1 year ago
isSSR
means currently ssr transform happening
and options.ssr
means enable building ssr output
So logic would be..
const generate = isSSR ? "ssr" : "dom"; // or maybe `options.ssr && isSSR ? "ssr" : "dom"`
const hydratable = options.ssr;
I think but I'm not sure that helps you much. You want to set hydratable to false and still generate "ssr" piggybacking on the option to build ssr seems wrong. I wonder if we can just look at the solid field if it exists
isSSR
means currently ssr transform happening andoptions.ssr
means enable building ssr outputSo logic would be..
const generate = isSSR ? "ssr" : "dom"; // or maybe `options.ssr && isSSR ? "ssr" : "dom"` const hydratable = options.ssr;
I think but I'm not sure that helps you much. You want to set hydratable to false and still generate "ssr" piggybacking on the option to build ssr seems wrong. I wonder if we can just look at the solid field if it exists
I need this mostly for distinction: some files transform in SSR mode, another not, respect {ssr: boolean}
foremost
From discord [1]
I made SSG prerendering, however, some HTML pages I want to make hydratable, others not. Currently I can only set hydratable: true or false. I would like avoid injecting my plugin personal plugin to change this flag for every page. Can we implement hook like hydratable: (entry) => boolean in vite-plugin-solid? Same with SSR
I need to prerender certain pages in ssg mode, so some chunks should be trasnformed with ssr: true option. However, this condition: https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L377 requires in my plugin change option explicitly:
I suggest something like: