Files
sx/examples/issue-0014.sx
2026-03-05 16:20:36 +02:00

16 lines
785 B
Plaintext

// issue-0014: Feature request — {{{ CONTENT_HASH }}} template variable for wasm shell
//
// When targeting wasm, the compiler processes shell.html and substitutes
// {{{ SCRIPT }}} with the <script> tag. Add a {{{ CONTENT_HASH }}} variable
// that is a short hash (e.g. 8-char hex) of the final build outputs
// (.js + .wasm + .data), so the shell can use it for cache busting:
//
// <script>
// Module.locateFile=function(path){return path+'?v={{{ CONTENT_HASH }}}'};
// </script>
// <script async src="index.js?v={{{ CONTENT_HASH }}}"></script>
//
// This lets browsers cache until the next build, then bust automatically.
// No changes needed to build.sx or modules/compiler.sx — just the compiler
// recognizing the new placeholder during shell template substitution.