Skip to content

Commit 2c323ae

Browse files
committed
u
1 parent 9f6e61a commit 2c323ae

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ pub mod swc {
3939
use std::{path::Path, sync::Arc};
4040

4141
use swc::{Compiler, PrintArgs, SwcComments};
42-
use swc_common::{chain, source_map::SourceMap, sync::Lrc, Mark, GLOBALS};
42+
use swc_common::{source_map::SourceMap, sync::Lrc, Mark, GLOBALS};
4343
use swc_ecma_ast::Program;
4444
use swc_ecma_parser::{EsSyntax, Parser, StringInput, Syntax, TsSyntax};
4545
use swc_ecma_transforms::resolver;
4646
use swc_ecma_transforms_react::{react, Options, Runtime};
4747
use swc_ecma_transforms_typescript::strip;
48-
use swc_ecma_visit::FoldWith;
4948
use swc_ecma_visit::VisitMutWith;
5049

5150
pub fn transform(path: &Path, source_text: &str) -> (Program, String) {
@@ -76,7 +75,7 @@ pub mod swc {
7675
syntax.typescript(),
7776
));
7877

79-
let mut ast_pass = chain!(
78+
let mut ast_pass = (
8079
strip(unresolved_mark, top_level_mark),
8180
react(
8281
Arc::clone(&cm),
@@ -86,10 +85,10 @@ pub mod swc {
8685
..Options::default()
8786
},
8887
top_level_mark,
89-
unresolved_mark
88+
unresolved_mark,
9089
),
9190
);
92-
let program = program.fold_with(&mut ast_pass);
91+
let program = program.apply(&mut ast_pass);
9392

9493
let printed = compiler
9594
.print(&program, PrintArgs::default())

0 commit comments

Comments
 (0)