diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 1cd8ae47ec82..029a34516b80 100644 --- a/bundler/Cargo.toml +++ b/bundler/Cargo.toml @@ -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.29.1" +version = "0.29.2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] diff --git a/bundler/src/inline.rs b/bundler/src/inline.rs index 88c5324e0eee..99e2b5320cc0 100644 --- a/bundler/src/inline.rs +++ b/bundler/src/inline.rs @@ -126,7 +126,7 @@ impl VisitMut for Inliner { Prop::Shorthand(i) => { let orig = i.clone(); i.visit_mut_with(self); - if i.span.ctxt != orig.span.ctxt { + if i.span.ctxt == orig.span.ctxt { return; } if i.sym != orig.sym { diff --git a/bundler/tests/fixture/deno-9868/case1/input/entry.ts b/bundler/tests/fixture/deno-9868/case1/input/entry.ts new file mode 100644 index 000000000000..fffac01ee43c --- /dev/null +++ b/bundler/tests/fixture/deno-9868/case1/input/entry.ts @@ -0,0 +1,5 @@ +import { foo } from './temp2.ts'; + +console.log({ + foo +}); \ No newline at end of file diff --git a/bundler/tests/fixture/deno-9868/case1/input/temp2.ts b/bundler/tests/fixture/deno-9868/case1/input/temp2.ts new file mode 100644 index 000000000000..eeafcde4751a --- /dev/null +++ b/bundler/tests/fixture/deno-9868/case1/input/temp2.ts @@ -0,0 +1,2 @@ +const bar = 1; +export { bar as foo }; \ No newline at end of file diff --git a/bundler/tests/fixture/deno-9868/case1/output/entry.inlined.ts b/bundler/tests/fixture/deno-9868/case1/output/entry.inlined.ts new file mode 100644 index 000000000000..dd1630abf42e --- /dev/null +++ b/bundler/tests/fixture/deno-9868/case1/output/entry.inlined.ts @@ -0,0 +1,3 @@ +console.log({ + foo: 1 +}); diff --git a/bundler/tests/fixture/deno-9868/case1/output/entry.ts b/bundler/tests/fixture/deno-9868/case1/output/entry.ts new file mode 100644 index 000000000000..553b9d76ddb6 --- /dev/null +++ b/bundler/tests/fixture/deno-9868/case1/output/entry.ts @@ -0,0 +1,4 @@ +const bar = 1; +console.log({ + foo: bar +});