An esbuild plugin for importing CSS, SVG, HTML, and XLIFF files as tagged-template literals (lit-html compatible) with optional minification via esbuild, html-minifier, and svgo. Current version 0.1.1, stable release. Differentiators: simplifies LitElement development by eliminating separate build steps for styles and assets; supports TypeScript with provided type declarations; enables direct import of XLIFF localization files without intermediate compilation. Peer dependencies include esbuild, lit, html-minifier, svgo, and txml.
npm install esbuild-plugin-litNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up the plugin with esbuild and import CSS/SVG files as tagged template literals in a LitElement.
None needed yet, but monitor package for breaking changes.
npm install svgo html-minifier --save-dev
npm install txml --save-dev and add `loader: { '.xlf': 'text' }` to esbuild config.Add `"include": ["./node_modules/esbuild-plugin-lit/modules.d.ts"]` to tsconfig.json.
Ensure custom filter extends the default by using pattern like /(\.css|\.svg|\.html|\.xlf|\.scss)$/
npm install html-minifier --save-dev
Add `"include": ["./node_modules/esbuild-plugin-lit/modules.d.ts"]` to tsconfig.json.
npm install esbuild --save-dev