Rewrites every registered custom element found in html into its Declarative
Shadow DOM prerendered form, preserving the element's attributes and light-DOM
children. Elements already carrying a <template shadowrootmode> are left
untouched (idempotent). The HTML is parsed inertly (no script execution); only
the Prerenderer's own window runs component code.
Exported so the transform can be unit-tested without Eleventy.
Rewrites every registered custom element found in
htmlinto its Declarative Shadow DOM prerendered form, preserving the element's attributes and light-DOM children. Elements already carrying a<template shadowrootmode>are left untouched (idempotent). The HTML is parsed inertly (no script execution); only the Prerenderer's own window runs component code.Exported so the transform can be unit-tested without Eleventy.