I am wondering what is the best way to save precompiled steering templates and include them in an HTML file.
Website: http://handlebarsjs.com/precompilation.html just advises calling
handlebars infile -f outfile
I put the template in a file and call the command. I got a JS file containing function1 function. How can I compile the second template now? The sample at http://jsperf.com/jquery-template-vs-handlebars contains several functions called program[1-9](...) I assume that they must be generated in some way. Good tip - store precompiled templates? I saw script attachment patterns or link tags in the HTML file and crawled them and through AJAX loading the templates and compiling them dynamically.
program[1-9](...)
Best, Bernhard
If you need several files, list them in the command like this:
handlebars file1 file2 file3 -f outfile
You want to store precompiled files for your production site, as it drastically reduces download time.
You have to use
handlebars /path/to/templates/*.handlebars -f /path/to/output/templates.js
The easiest way, provided that you want to save your templates with the html extension: handlebars html
i.e.: handlebars./-e html -f precompiled_templates.js
Source: https://habr.com/ru/post/1413852/More articles:CodeIgniter includes js, css files from application returned 403 is prohibited - apacheHow to vertically align a div with an absolute position on top of each other? - jqueryHow to find out what permission is required for an application for Windows 7 - windowsMonotouch how to extract an AtIndex object from NSArray in C # - c #java.lang.IllegalAccessError when calling java from scala - solutions / workarounds? - javaTemplate: Toolkit Variable Handling - perlHow to remove leaf items in a Scala collection? - scalaRegEx function to exclude using Notepad ++ - regexHow to signal caller thread that ExecutorService completed a task - javaXSLT Transformation to add multiple non-existing children - xmlAll Articles