Is there something similar to the webpack html plugin for ClojureScript?



For Javascript projects with webpack, I’m used to this plugin:
Instead of writing my own static index.html file, the plugin generates an index.html file that includes the compiled bundles (JS, CSS, etc…). For example, for development it will create an html file with a <script src="bundle.js"></script> tag, while for production it will generate something like <script src="bundle.HASH.js"></script>
Is there something similar for ClojureScript? I’m using figwheel-main, but looks like there isn’t anything similar out of the box


I’m using my own script for generating HTML. A script of adding virtual DOMs and it handles src property in my cljs code.



Shadow-CLJS seems to support it. Ctrl+f for module-hash-names.

As I understand it, Figwheel is primarily a development tool. Shadow-CLJS provides help all the way to production. That is, shadow can hot-load your code in development and compile it for production. If you would like to use Figwheel for development and have module hashing for production, I think you’d have to look into the CLJS build API, and make a build script that computes hashes, renames files and generates links in index.html accordingly. Which isn’t exactly what you were asking for.

Hope that helps!