Map commonjs named imports back to the correct location - fixes #1987

This commit is contained in:
Logan Smyth 2015-08-01 10:09:00 -07:00
parent b5bd7b1c92
commit c738d8d388
2 changed files with 21 additions and 1 deletions

View File

@ -92,7 +92,8 @@ export default class CommonJSFormatter extends DefaultFormatter {
])); ]));
} else { } else {
// import { foo } from "foo"; // 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)));
} }
} }
} }

View File

@ -0,0 +1,19 @@
[{
"original": {
"line": 6,
"column": 0
},
"generated": {
"line": 5,
"column": 6
}
}, {
"original": {
"line": 9,
"column": 0
},
"generated": {
"line": 8,
"column": 6
}
}]