fix(bundler): Fix bundler (#2510)

swc_bundler:
 - Consider usage in named export specifier while analyzing imports.
This commit is contained in:
Donny/강동윤 2021-10-25 01:25:59 +09:00 committed by GitHub
parent a8b29b662e
commit cead404a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 2 deletions

2
Cargo.lock generated
View File

@ -2431,7 +2431,7 @@ dependencies = [
[[package]]
name = "swc_bundler"
version = "0.77.0"
version = "0.77.1"
dependencies = [
"ahash",
"anyhow",

View File

@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"]
license = "Apache-2.0/MIT"
name = "swc_bundler"
repository = "https://github.com/swc-project/swc.git"
version = "0.77.0"
version = "0.77.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]

View File

@ -557,6 +557,8 @@ where
}
fn visit_mut_export_named_specifier(&mut self, s: &mut ExportNamedSpecifier) {
self.add_forced_ns_for(s.orig.to_id());
match &s.exported {
Some(exported) => {
debug_assert_eq!(

View File

@ -0,0 +1,2 @@
import { foo } from "./temp2.ts";
foo.hello(1);

View File

@ -0,0 +1,3 @@
import * as foo from "./temp3.ts";
export { foo };
foo.hello(2);

View File

@ -0,0 +1,3 @@
export function hello(n) {
console.log("Hello", n);
}