Skip to content

SWC Transform to prefix logs. Useful for adding file and line number to logs

License

Notifications You must be signed in to change notification settings

williamtetlow/swc-plugin-console-prefix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

SWC Transform to prefix logs. Useful for adding file and line number to logs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages