Esbuild plugin to load static assets as tagged-template literals #2696
zandaqo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In case any other Lit and esbuild users find it annoying to inline/wrap with tags their static stylesheets, svg icons/illustrations, or even static html pages, I cobbled up a small plugin to do just that: allow importing static css/svg/html files and wrapping them in their respective tags (css/html). As an extra bonus, it also minifies the files using built-in esbuild minification in case of CSS. It's just a couple dozen lines of code and has no dependencies, though, it will try to minify svg files with
svgo
if present.Beta Was this translation helpful? Give feedback.
All reactions