A fast SWC-based transpiler for LitElement and other custom elements. Version 1.0.0 focuses on converting decorator and template syntax to standard JavaScript with minimal overhead. Ships TypeScript types for better DX. Compared to Babel-based alternatives, it leverages SWC's Rust core for up to 20x faster compilation. Ideal for large web component projects and build pipelines. Currently in early release, no stable release cadence yet.
npm install lit-swc-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: transpile a LitElement with decorators and TypeScript, outputting standard JS.
Enable TypeScript mode by setting `ts: true` option, or pre-process with a decorator transformer.
Use `transpile` instead. `transform` will be removed in v2.
Add `import { css } from 'lit';` in your source files.Pass `sourceMaps: true` in options to get inline source maps.
Run `npm install lit-swc-transpiler` and ensure import path is correct.
Change `const { transpile } = require('lit-swc-transpiler')` to `import { transpile } from 'lit-swc-transpiler'`.Either rename file to .ts or pass `ts: true` in options.