Skip to content

Commit

Permalink
Enforce running the gjs transform before any others
Browse files Browse the repository at this point in the history
simonihmig committed Oct 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 93da6df commit 37fa5f4
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions packages/addon-dev/src/rollup-gjs-plugin.ts
Original file line number Diff line number Diff line change
@@ -13,17 +13,21 @@ export default function rollupGjsPlugin(
return {
name: PLUGIN_NAME,

transform(input: string, id: string) {
if (!gjsFilter(id)) {
return null;
}
let code = processor.process(input, {
filename: id,
inline_source_map,
});
return {
code,
};
transform: {
// Enforce running the gjs transform before any others like babel that expect valid JS
order: 'pre',
handler(input: string, id: string) {
if (!gjsFilter(id)) {
return null;
}
let code = processor.process(input, {
filename: id,
inline_source_map,
});
return {
code,
};
},
},
};
}

0 comments on commit 37fa5f4

Please sign in to comment.