fix(swc): Respect jsc.experimental.keepImportAssertions (#3352)

swc:
 - Fix `Merge` impl of `JscExperimental`.
This commit is contained in:
Donny/강동윤 2022-01-24 22:06:17 +09:00 committed by GitHub
parent b7c2e13237
commit d9dc2b99dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -985,8 +985,13 @@ pub struct JscExperimental {
impl Merge for JscExperimental { impl Merge for JscExperimental {
fn merge(&mut self, from: &Self) { fn merge(&mut self, from: &Self) {
if self.plugins.is_none() { if self.plugins.is_none() {
*self = from.clone(); self.plugins = from.plugins.clone();
} }
if self.cache_root.is_none() {
self.cache_root = from.cache_root.clone();
}
self.keep_import_assertions |= from.keep_import_assertions;
} }
} }