Closed ef4 closed 1 year ago
I confirmed locally that this PR fixes https://github.com/ember-template-imports/ember-template-imports/pull/211
Does this also work with amd transform? Would be good to have a test for it too .
Btw, thanks for basing this on my pr. Much appreciated. if this works well, also with AMD transform, then this is better
I also saw now that amd transform runs an program:exit
Builds off https://github.com/emberjs/babel-plugin-ember-template-compilation/pull/31 to fix https://github.com/emberjs/babel-plugin-ember-template-compilation/pull/30.
Instead of keeping everything as in https://github.com/emberjs/babel-plugin-ember-template-compilation/pull/31 (which is not safe in general), we use the
pre
to take a snapshot of available imports and then only when we discover that a template wants to use a name that is not in scope do we check if it was in the original set of available imports and reintroduce an import for it.