Map commonjs named imports back to the correct location - fixes #1987
This commit is contained in:
parent
b5bd7b1c92
commit
c738d8d388
@ -92,7 +92,8 @@ export default class CommonJSFormatter extends DefaultFormatter {
|
||||
]));
|
||||
} else {
|
||||
// import { foo } from "foo";
|
||||
this.remaps.add(scope, variableName.name, t.memberExpression(ref, specifier.imported));
|
||||
this.remaps.add(scope, variableName.name,
|
||||
t.memberExpression(ref, t.identifier(specifier.imported.name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
[{
|
||||
"original": {
|
||||
"line": 6,
|
||||
"column": 0
|
||||
},
|
||||
"generated": {
|
||||
"line": 5,
|
||||
"column": 6
|
||||
}
|
||||
}, {
|
||||
"original": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"generated": {
|
||||
"line": 8,
|
||||
"column": 6
|
||||
}
|
||||
}]
|
||||
Loading…
x
Reference in New Issue
Block a user