Replies: 2 comments
-
Dupe #5412 |
Beta Was this translation helpful? Give feedback.
0 replies
-
After fixing #5412 and update Edited code with least compile errors as I could// lib.rs
use swc_core::{
ast::*, // <--- should be changed after template generation
common::Spanned, // <--- should be added. (In documentation, it uses swc_plugin)
plugin::{plugin_transform, proxies::TransformPluginProgramMetadata},
testing_transform::test,
visit::{as_folder, FoldWith, VisitMut, VisitMutWith}, // <--- VisitMutWIth should be added
};
impl VisitMut for TransformVisitor {
fn visit_mut_bin_expr(&mut self, e: &mut BinExpr) {
e.visit_mut_children_with(self);
if e.op == op!("===") {
e.left = Ident::new("kdy1".into(), e.left.span()).into();
}
}
} Error
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I came here from #3540 .
I was trying to make a rust based swc plugin with this tutorial, but I couldn't follow the instructions. I think something is missing or document is outdated.
cargo test
Input code
Config
No .swcrc was used.
Playground link
No response
Expected behavior
There is no specific description on the tutorial page. I think errors should not be happened.
Actual behavior
Following errors were generated.
(...etc)
Version
swc_cli: 0.89.0 (not @swc/cli)
Additional context
Run on WSL2 Ubuntu 20.04
Version
rustc: 1.62.1
rustup: 1.25.1
cargo 1.62.1
Reproducible Repository
https://github.com/Phryxia/swc-plugin-tutorial-seems-broken
Beta Was this translation helpful? Give feedback.
All reactions