web
web copied to clipboard
[rollup-plugin-html] Change file extension of transformed asset?
I want to be able to use a template format such as hbs or ejs for some assets.
I tried making the following transform function to do this but I'm not able to drop the ".hbs"/".ejs" extensions from the transformed file's name.
{
transformAsset: async (content, filePath) => {
if (filePath.endsWith(".hbs")) {
const hbsContent = content.toString("utf-8");
return renderHbs(hbsContent);
}
if (filePath.endsWith(".ejs")) {
const ejsContent = content.toString("utf-8");
return renderEjs(ejsContent);
}
}
}
Is it possible / could it be made possible for me to change the file extension of the transformed file?
+1