Plugin.registerCompiler({ extensions: ['html'], archMatching: 'web', isTemplate: true }, () => new CachingHtmlCompiler("static-html", TemplatingTools.scanHtmlForTags, compileTagsToStaticHtml)); // Same API as TutorialTools.compileTagsWithSpacebars, but instead of compiling // with Spacebars, it just returns static HTML function compileTagsToStaticHtml(tags) { var handler = new StaticHtmlTagHandler(); tags.forEach((tag) => { handler.addTagToResults(tag); }); return handler.getResults(); }; var isEmpty = obj => [Object, Array].includes((obj || {}).constructor) && !Object.entries((obj || {})).length; class StaticHtmlTagHandler { constructor() { this.results = { head: '', body: '', js: '', bodyAttrs: {} }; } getResults() { return this.results; } addTagToResults(tag) { this.tag = tag; // do we have 1 or more attributes? const hasAttribs = ! isEmpty(this.tag.attribs); if (this.tag.tagName === "head") { if (hasAttribs) { this.throwCompileError("Attributes on not supported"); } this.results.head += this.tag.contents; return; } // or