1.0.1 • Published 16 days ago
babel-plugin-here v1.0.1
Babel Plugin Here (babel-plugin-here
)
Replace instances of
HERE
identifier with code position strings.
Why?
This plugin is useful when you don't have sourcemaps and you're looking at errors in the console and having trouble knowing where they've come from. You can setup this plugin, and use HERE
in error message like throw new Error(`${HERE} Some useful message`)
.
Setup
Install
npm install --save-dev babel-plugin-here
Babel config
babel.config.json
{
"plugins": [ "babel-plugin-here" ]
}
TSConfig (if using TypeScript)
tsconfig.json
{
"compilerOptions": {
"types": [ "babel-plugin-here/env" ]
}
}
Example
In
src/foo.js
console.log(HERE)
dist/foo.js
console.log("src/foo.js:1:13")
1.1.0-c19b86f
16 days ago
1.0.1
1 month ago
1.1.0-dc49d97
1 month ago
1.1.0-8ab40b1
1 month ago
1.1.0-b757535
1 month ago
1.1.0-3e07890
1 month ago
1.1.0-185237b
3 months ago
1.1.0-3b03cf3
3 months ago
1.0.0
3 months ago
0.1.0-e0e08a2
3 months ago
1.1.0-43a2acc
3 months ago
0.1.0-72748da
3 months ago
0.0.1
10 months ago