Skip to content

Releases: preactjs/vite-prerender-plugin

0.5.2

05 Jan 02:31
Compare
Choose a tag to compare

Maintenance

We have a new home! Being an extracted copy of @preact/preset-vite prerenderer (soon to be replaced w/ this package), and building upon past Preact APIs, it made sense to move this over to the Preact repo. Will still be framework-agnostic and we'd love to see apps in other frameworks using it!

Bug Fixes

  • Better error handling during prerender process

Full Changelog: 0.5.1...0.5.2

0.5.1

04 Jan 08:58
Compare
Choose a tag to compare

Bug Fixes

  • Fixes error handling in a variety of cases, ensures source maps can be used more often to point at error sources

Full Changelog: 0.5.0...0.5.1

0.5.0

09 Dec 06:42
Compare
Choose a tag to compare

Features

  • Warns if the prerender function returns nothing, rather than moving on silently
  • Ensures Vite's modulepreload polyfill is inlined

Bug Fixes

  • Corrects bad options destructure, throwing an error if an empty object isn't passed
  • Ensures JS assets also have source map comments stripped if the user hasn't enabled them themselves

Full Changelog: 0.4.0...0.5.0

0.3.0

10 Jul 05:33
Compare
Choose a tag to compare

Features

  • Adds new parseLinks export to mirror the functionality of preact-iso's prerender. This allows you to easily crawl through generated anchor tags to find additional links for the prerenderer:
export async function prerender(data) {
    const { renderToString } = await import('react-dom/server');
+   const { parseLinks } = await import('vite-prerender-plugin/parse');

    const html = await renderToString(<App {...data} />);
+   const links = parseLinks(html);

+   return { html, links };
}

Bug Fixes

  • Corrects bad regex for stripping out source maps, resulting in erroneous "missing source map" warnings in the browser

Full Changelog: 0.2.2...0.3.0