1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#![cfg_attr(docsrs, feature(doc_cfg))]
pub use swc_common::{
chain,
plugin::{PluginError, Serialized},
};
pub mod comments {
pub use swc_common::comments::{Comment, CommentKind, Comments};
pub use swc_plugin_proxy::PluginCommentsProxy;
}
pub mod source_map {
pub use swc_common::source_map::{CharPos, Loc, MultiByteChar, NonNarrowChar, Pos, SourceFile};
pub use swc_plugin_proxy::PluginSourceMapProxy;
}
pub mod utils {
pub use swc_common::util::take;
#[cfg(feature = "swc_ecma_quote")]
#[cfg_attr(docsrs, doc(cfg(feature = "quote")))]
pub use swc_ecma_quote::*;
pub use swc_ecma_utils::*;
}
pub mod ast {
pub use swc_atoms::*;
pub use swc_ecma_ast::*;
pub use swc_ecma_visit::*;
}
pub mod syntax_pos {
pub use swc_common::{Mark, Span, DUMMY_SP};
}
mod handler;
pub mod errors {
pub use swc_common::errors::{Diagnostic, Handler, Level};
pub use crate::handler::HANDLER;
}
pub mod environment {
pub use crate::handler::*;
}
pub use swc_plugin_macro::plugin_transform;
use swc_plugin_proxy::{PluginCommentsProxy, PluginSourceMapProxy};
#[cfg(target_arch = "wasm32")]
mod allocation;
#[cfg(target_arch = "wasm32")]
pub mod memory {
pub use crate::allocation::*;
}
mod pseudo_scoped_key;
#[derive(Debug)]
pub struct TransformPluginProgramMetadata {
pub comments: Option<PluginCommentsProxy>,
pub source_map: PluginSourceMapProxy,
pub plugin_config: String,
pub transform_context: String,
}