Search code examples
typescriptgrunt-ts

Turning .html templates into AMD modules with grunt-ts


Using grunt-ts with say the html: ["*.tpl.html"] option, it compiles *.tpl.html files in the end into *.tpl.html.js files, which set a global var.

Can I instead tell grunt-ts to output the final .js file in a different module syntax, such as AMD or CommonJS, (to avoid using globals)?


Solution

  • Can I instead tell grunt-ts to output the final .js file in a different module syntax, such as AMD or CommonJS, (to avoid using globals)

    Not at the moment. The whole html template mechanism was written before module systems exploded in popularity.