A Rollup plugin that transforms lit-html templates at build time using SWC (Speedy Web Compiler). Current stable version is 0.3.3, released in early 2023, with low release cadence (last update over a year ago). It optimizes LitElement and lit-html templates by inlining static parts, reducing runtime overhead and bundle size. Key differentiators: uses SWC for fast transformation, supports custom elements and web components. Alternative tools like @open-wc/building-rollup or @lit/context exist, but this plugin is specifically for Rollup and SWC integration.
npm install rollup-plugin-lit-transformerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic Rollup config using litTransformer plugin with SWC for transforming Lit templates in a TypeScript project.
Switch to @lit/rollup-plugin-lit-html or @open-wc/building-rollup for better maintenance.
Order plugins: litTransformer() first, then transpilers (e.g., swcPlugin).
Use default import `import litTransformer from 'rollup-plugin-lit-transformer'`.
Install @swc/core with `npm install @swc/core`.
Switch to ESM (use import) or dynamic import: `const litTransformer = (await import('rollup-plugin-lit-transformer')).default`.