2
2
3
3
use std:: {
4
4
env,
5
- path:: { Path , PathBuf } ,
5
+ path:: Path ,
6
6
sync:: Arc ,
7
7
} ;
8
8
9
9
use farmfe_core:: {
10
10
config:: { config_regex:: ConfigRegex , Config } ,
11
11
context:: CompilationContext ,
12
12
error:: CompilationError ,
13
- plugin:: { Plugin , PluginProcessModuleHookParam , PluginTransformHookResult } ,
14
- swc_common:: { comments:: NoopComments , BytePos , Mark , SourceMap , DUMMY_SP } ,
15
- swc_ecma_ast:: { self , Expr , Ident , Lit , MemberExpr , MemberProp , Module , Str } ,
16
- swc_ecma_parser:: { EsConfig , Parser , StringInput , Syntax } ,
13
+ plugin:: { Plugin , PluginProcessModuleHookParam } ,
14
+ swc_common:: DUMMY_SP ,
15
+ swc_ecma_ast:: { self , Expr , Lit , MemberExpr , MemberProp , Module , Str } ,
17
16
} ;
18
17
19
18
use farmfe_macro_plugin:: farm_plugin;
20
19
use farmfe_toolkit:: {
21
- common:: { create_swc_source_map, PathFilter , Source } ,
22
- script:: swc_try_with:: try_with,
23
- swc_ecma_codegen:: { self , text_writer:: JsWriter , Emitter } ,
24
- swc_ecma_transforms:: { helpers:: inject_helpers, typescript:: tsx} ,
20
+ common:: PathFilter ,
25
21
swc_ecma_visit:: { VisitMut , VisitMutWith } ,
26
22
} ;
27
23
use serde;
@@ -47,7 +43,7 @@ impl Default for ReplaceDirnameOptions {
47
43
}
48
44
49
45
impl FarmPluginReplaceDirname {
50
- fn new ( config : & Config , options : String ) -> Self {
46
+ fn new ( _ : & Config , options : String ) -> Self {
51
47
let options: ReplaceDirnameOptions = serde_json:: from_str ( & options) . unwrap_or_default ( ) ;
52
48
Self { options }
53
49
}
@@ -61,7 +57,7 @@ impl Plugin for FarmPluginReplaceDirname {
61
57
fn process_module (
62
58
& self ,
63
59
param : & mut PluginProcessModuleHookParam ,
64
- context : & Arc < CompilationContext > ,
60
+ _ : & Arc < CompilationContext > ,
65
61
) -> Result < Option < ( ) > , CompilationError > {
66
62
let filter = PathFilter :: new ( & self . options . include , & self . options . exclude ) ;
67
63
if !filter. execute ( & param. module_id . relative_path ( ) ) {
0 commit comments