-
Run
Preprocessor.parse
from content-tag to get template locations. manually convert gjs files with<template>
tags into valid JS, which doesn't change location. The<template>
tag gets converted into empty strings. -
convert empty string to a custom
Template
Ast node, which holds the template content. -
Run the
estree
Prettier printer, which formats the valid JS above. -
Grab template contents from
Template
AST node described above. -
Run the hbs Prettier printer against the template contents.
-
Replace the
Template
AST node with the results from above, wrapped in<template>
, like so:<template> <h1>Hello</h1> </template>