We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef3abe4 commit addacaaCopy full SHA for addacaa
src/plugin.ts
@@ -172,13 +172,10 @@ export function makePlugin<EnvSpecificOptions>(loadOptions: (opts: EnvSpecificOp
172
parentPath: null,
173
container: state.ast,
174
});
175
- const p = program.get('body');
176
for (const i of imports) {
177
- const idx = state.ast.program.body.indexOf(i);
178
- const impNodePath = p[idx] as NodePath<t.ImportDeclaration>;
179
- const specifiers = impNodePath.get('specifiers');
+ const specifiers = i.specifiers;
180
for (const specifier of specifiers) {
181
- const local = specifier.get('local');
+ const local = specifier.local;
182
if (!state.scope.getBinding(local.node.name)?.referencePaths.length) {
183
state.scope.getBinding(local.node.name)?.referencePaths.push(program);
184
}
0 commit comments