Preserve import binding locations during module rewriting (#7378)

* Only wrap import references that need it.

* Preserve the import binding location for sourcemaps.

* Add tests.
This commit is contained in:
Logan Smyth
2018-02-14 10:17:27 -08:00
committed by GitHub
parent 128fc6864e
commit e732ee0c5b
6 changed files with 232 additions and 6 deletions

View File

@@ -0,0 +1,14 @@
import aDefault from "one";
import { aNamed } from "two";
import { orig as anAliased } from "three";
import * as aNamespace from "four";
console.log(aDefault);
console.log(aNamed);
console.log(anAliased);
console.log(aNamespace);
console.log(aDefault());
console.log(aNamed());
console.log(anAliased());
console.log(aNamespace());