Test and fix export statement sourcemap

This commit is contained in:
Amjad Masad
2016-03-08 13:47:02 -08:00
parent 108838c66c
commit 46ebd90acb
2 changed files with 14 additions and 3 deletions

View File

@@ -184,7 +184,9 @@ export default function () {
// Copy location from the original import statement for sourcemap
// generation.
varDecl.loc = imports[source].loc;
if (imports[source]) {
varDecl.loc = imports[source].loc;
}
if (typeof blockHoist === "number" && blockHoist > 0) {
varDecl._blockHoist = blockHoist;
@@ -338,9 +340,11 @@ export default function () {
path.replaceWithMultiple(nodes);
}
} else if (path.isExportAllDeclaration()) {
topNodes.push(buildExportAll({
let exportNode = buildExportAll({
OBJECT: addRequire(path.node.source.value, path.node._blockHoist)
}));
});
exportNode.loc = path.node.loc;
topNodes.push(exportNode);
path.remove();
}
}