swc-plugin-console-prefix
SWC Transform to prefix logs. Useful for adding file and line number to logs
{
"jsc": {
"experimental": {
"plugins": [
["swc-plugin-console-prefix", { "prefixPattern": "hello", "ignore": ["info"] }]
]
}
}
}
// test.js
console.log('world')
$ npx swc ./test.js
// output
console.log('hello', 'world')
Run example
cargo run --package swc-plugin-console-source --example usage
Test
cargo test -- --exact --nocapture
Build
# dev
cargo build --target=wasm32-wasi
# release
cargo build --release --target=wasm32-wasi