You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested many (if not all) esbuild html plugins, and this is by far the better. But I have one question: how about adding a preprocess option, that lets user execute task on html at the start of the process? It could be useful to replace some text, or use a preprocessor.
For instance, something like this in the build, to preprocess using ejs
esbuild.build({
...,plugins: [htmlPlugin({preprocess(html){returnejs.render(html,{title: 'A title'});}})]})
And in the lib, just before lines 182/183 of lib/index.js:
Maybe, I'm thinking in the wrong direction, but I cannot manage to use other preprocessor plugins (like ejs or pug) with HTML files. They all build JS.
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
I tested many (if not all) esbuild html plugins, and this is by far the better. But I have one question: how about adding a
preprocess
option, that lets user execute task on html at the start of the process? It could be useful to replace some text, or use a preprocessor.For instance, something like this in the build, to preprocess using
ejs
And in the lib, just before lines 182/183 of
lib/index.js
:Maybe, I'm thinking in the wrong direction, but I cannot manage to use other preprocessor plugins (like ejs or pug) with HTML files. They all build JS.
Thanks.
The text was updated successfully, but these errors were encountered: