-
Run
Preprocessor.parsefrom 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
TemplateAst node, which holds the template content. -
Run the
estreePrettier printer, which formats the valid JS above. -
Grab template contents from
TemplateAST node described above. -
Run the hbs Prettier printer against the template contents.
-
Replace the
TemplateAST node with the results from above, wrapped in<template>, like so:<template> <h1>Hello</h1> </template>