@swc-contrib/mut-cjs-exports 10.7.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib.rs +5 -8
- package/src/utils.rs +2 -2
- package/swc_mut_cjs_exports.wasm +0 -0
package/package.json
CHANGED
package/src/lib.rs
CHANGED
|
@@ -148,14 +148,11 @@ impl VisitMut for TransformVisitor {
|
|
|
148
148
|
match n {
|
|
149
149
|
JSXElementName::Ident(ref_ident) => {
|
|
150
150
|
if self.export_decl_id.contains(&ref_ident.to_id()) {
|
|
151
|
-
*n = JSXElementName::JSXMemberExpr(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
.into(),
|
|
158
|
-
);
|
|
151
|
+
*n = JSXElementName::JSXMemberExpr(JSXMemberExpr {
|
|
152
|
+
span: DUMMY_SP,
|
|
153
|
+
obj: self.exports().into(),
|
|
154
|
+
prop: ref_ident.clone().into(),
|
|
155
|
+
});
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
_ => n.visit_mut_children_with(self),
|
package/src/utils.rs
CHANGED
|
@@ -126,14 +126,14 @@ pub(crate) fn emit_export_stmts(exports: Ident, export: Export) -> Vec<Stmt> {
|
|
|
126
126
|
pub(crate) fn key_from_export_name(n: &ModuleExportName) -> (Atom, Span) {
|
|
127
127
|
match n {
|
|
128
128
|
ModuleExportName::Ident(ident) => (ident.sym.clone(), ident.span),
|
|
129
|
-
ModuleExportName::Str(
|
|
129
|
+
ModuleExportName::Str(s) => (s.value.clone(), s.span),
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
pub(crate) fn local_ident_from_export_name(n: ModuleExportName) -> Ident {
|
|
134
134
|
let name = match n {
|
|
135
135
|
ModuleExportName::Ident(ident) => ident.sym,
|
|
136
|
-
ModuleExportName::Str(
|
|
136
|
+
ModuleExportName::Str(s) => s.value,
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
match Ident::verify_symbol(&name) {
|
package/swc_mut_cjs_exports.wasm
CHANGED
|
Binary file
|