Open NotArpit opened 7 months ago
https://esbuild.github.io/content-types/#external-file - simplest solution. Other ways are depend on possible .html processing and so on.
Thanks - unfortunately that's not what I'm looking for. As I understand it using the external-file
approach only copies the file directly to the output bundle. Rather I was wondering if there is a way to export the HTML as a string so it's all contained inside the bundle and the HTML is injected via JavaScript.
if there is a way to export the HTML as a string so it's all contained inside the bundle and the HTML
https://esbuild.github.io/content-types/#text
...injected via JavaScript.
It doesn't work like that, sorry ) You have to provide exact expectations - what should happen with .html file content. As an example, for one of my projects I use React SSR (and simple esbuild plugin) to create .html files as part of build process.
I am currently trying to bundle and minify my service - however a package listed as a transitive dependency (i.e.
@mapbox/node-pre-gyp
) contains a*.html
file. Resulting in the following error during bundling/minification.Is there any existing loader/plugin in
esbuild
for*.html
files? Couldn't find any helpful documentation. Namely, I'm looking for anesbuild
equivalent to webpacks html-loaderAny help is appreciated !