How can I precompile HandlebarsJS templates from Visual Studio?

后端 未结 3 1751
悲哀的现实
悲哀的现实 2021-02-03 12:57

Is it possible to precompile Handlebars Templates from a postbuild event of Visual Studio or in the App_Start of a MVC web app? Thanks so much in advance. Dale

3条回答
  •  醉话见心
    2021-02-03 13:38

    Sure, you have many options:

    1. You can install node.js for windows and npm, and configure a post-build event to the compilation (example here from previous question)
    2. If you're using ember.js, here's an implementation that uses bundle transformation to achieve precompilation.
    3. Another for ember.js that supports components, here's the implementation, that also uses bundle transformation.
    4. Here is an example of compilation on C# using the Jurassic javascript compiler

提交回复
热议问题