v155 · text modules

A template you can edit

A receipt template, imported as text and rendered against data you can change. The reload button is the part worth playing with: a module is instantiated once, so importing the same specifier again gives you the cached module — not a fresh read of the file.

Render

Loading the template…

Rendered

The template, as imported

A module specifier is the cache key. Importing ./receipt.tmpl twice returns the same module object both times; importing ./receipt.tmpl?v=2 is a different specifier, so it is fetched again. That is the same rule that has always governed JavaScript modules — text modules do not add a new one, which is exactly the point.

see also