But adding them to your html in a script tag has some drawbacks. First we’d like to minimize the size of your html.
Second, we’re missing syntax highlighting in the IDE. And third, wouldn’t it be great if it was lazy loaded?
“But darling that’s three wishes altogether! You know that’s not possible!”
“But yes, it is possible!” Just use this little
With this little snippet you can load any template lazily:
The template itself is a regular html snippet, so any decent IDE will give you
syntax highlighting and code completion. Your main html file is clean and small
and the script is loaded lazily.
“KinderSurprise three wishes at once” - from DukeScript!
P.s.: This is just one (very simple) way of doing it. Stay tuned for more feature rich alternatives.