Skip to content

Commit

Permalink
Bump swc (#7931)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored Apr 11, 2022
1 parent fdeb508 commit 6be49aa
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 144 deletions.
116 changes: 58 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/transformers/js/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ edition = "2018"
crate-type = ["rlib"]

[dependencies]
swc_ecmascript = { version = "0.142.0", features = ["parser", "transforms", "module", "optimization", "react", "typescript", "utils", "visit", "codegen", "utils", "preset_env"] }
swc_common = { version = "0.17.19", features = ["tty-emitter", "sourcemap"] }
swc_ecmascript = { version = "0.143.0", features = ["parser", "transforms", "module", "optimization", "react", "typescript", "utils", "visit", "codegen", "utils", "preset_env"] }
swc_common = { version = "0.17.21", features = ["tty-emitter", "sourcemap"] }
swc_atoms = "0.2.11"
indoc = "1.0.3"
serde = "1.0.123"
Expand Down
18 changes: 3 additions & 15 deletions packages/transformers/js/core/src/dependency_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ impl<'a> DependencyCollector<'a> {
});

create_url_constructor(
ast::Expr::Lit(ast::Lit::Str(ast::Str {
span,
value: placeholder.into(),
raw: None,
})),
ast::Expr::Lit(ast::Lit::Str(placeholder.into())),
self.config.is_esm_output,
)
}
Expand Down Expand Up @@ -1023,11 +1019,7 @@ fn create_url_constructor(url: ast::Expr, use_import_meta: bool) -> ast::Expr {
// CJS output: "file:" + __filename
Expr::Bin(BinExpr {
span: DUMMY_SP,
left: Box::new(Expr::Lit(Lit::Str(Str {
value: "file:".into(),
span: DUMMY_SP,
raw: None,
}))),
left: Box::new(Expr::Lit(Lit::Str("file:".into()))),
op: BinaryOp::Add,
right: Box::new(Expr::Ident(Ident::new("__filename".into(), DUMMY_SP))),
})
Expand Down Expand Up @@ -1227,11 +1219,7 @@ impl<'a> DependencyCollector<'a> {
String::from("unknown.js")
};

Expr::Lit(Lit::Str(Str {
value: format!("file:///{}", filename).into(),
span: DUMMY_SP,
raw: None,
}))
Expr::Lit(Lit::Str(format!("file:///{}", filename).into()))
}

fn get_import_meta(&mut self) -> ast::Expr {
Expand Down
Loading

0 comments on commit 6be49aa

Please sign in to comment.