mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 21:20:41 +08:00
This is already used for more than just themes, and we plan to extend its usage even further
19 lines
456 B
JavaScript
Vendored
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,
|
|
};
|
|
}
|
|
},
|
|
},
|
|
};
|
|
}
|