discourse/app/assets/javascripts/asset-processor/rollup-plugins/discourse-hbs.js
David Taylor 585ba17f56
DEV: Rename theme-transpiler to asset-processor (#35498)
This is already used for more than just themes, and we plan to extend
its usage even further
2025-10-20 14:16:46 +01:00

19 lines
456 B
JavaScript
Vendored

export default function discourseHbs() {
return {
name: "discourse-hbs",
transform: {
order: "pre",
handler(input, id) {
if (id.endsWith(".hbs")) {
return {
code: `
import { hbs } from 'ember-cli-htmlbars';
export default hbs(${JSON.stringify(input)}, { moduleName: ${JSON.stringify(id)} });
`,
map: null,
};
}
},
},
};
}