0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/frontend/asset-processor/rollup-plugins/discourse-gjs.js
David Taylor d1e1c02fcb DEV: Rename app/assets/javascripts/ -> frontend/
Commit created with `mv app/assets/javascripts frontend && git add .`
2025-10-22 16:24:11 +01:00

26 lines
572 B
JavaScript
Vendored

import { Preprocessor } from "../content-tag";
const preprocessor = new Preprocessor();
export default function discourseGjs() {
return {
name: "discourse-gjs",
transform: {
// Enforce running the gjs transform before any others like babel that expect valid JS
order: "pre",
handler(input, id) {
if (!id.endsWith(".gjs")) {
return null;
}
let { code, map } = preprocessor.process(input, {
filename: id,
});
return {
code,
map,
};
},
},
};
}