Skip to content

Commit bd784a7

Browse files
authored
Merge pull request #20330 from emberjs/backburner-shenanigans
types: work around backburner runtime paths shenanigans
2 parents 5cb0cc9 + f934d88 commit bd784a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

types/publish.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,14 @@ export function rewriteModule(code, moduleName) {
563563
let source = path.node.source;
564564
if (isStringLiteral(source)) {
565565
source.value = normalizeSpecifier(moduleName, source.value);
566+
567+
// This makes it so that the types we publish point to the types defined
568+
// by `backburner.js`, basically doing the type-time equivalent of the
569+
// no good, very bad runtime shenanigans Ember does... *somewhere*... in
570+
// the build to make `import Backburner from 'backburner'` work.
571+
if (source.value === 'backburner') {
572+
source.value = 'backburner.js';
573+
}
566574
}
567575
this.traverse(path);
568576
},

0 commit comments

Comments
 (0)