I've recently made a tweak to the ai2html script to generate .preview.html files that you can use to see how the ai2html embed will look on a page. While this is a helpful feature, we do not want to import these files into the projects — otherwise we're importing very long, unnecessary strings and adding about 1mb to the bundle size.
To avoid this, I'm using the Negative Patterns feature of Vite's import.meta.glob, to import .html files but ignore .preview.html files in the graphics/ glob expression.
I've recently made a tweak to the
ai2html
script to generate.preview.html
files that you can use to see how the ai2html embed will look on a page. While this is a helpful feature, we do not want to import these files into the projects — otherwise we're importing very long, unnecessary strings and adding about 1mb to the bundle size.To avoid this, I'm using the Negative Patterns feature of Vite's
import.meta.glob
, to import.html
files but ignore.preview.html
files in thegraphics/
glob expression.