1.0.2 • Published 8 months ago
babel-plugin-here v1.0.2
Babel Plugin Here (babel-plugin-here)
Replace instances of
HEREidentifier 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-hereBabel 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)Out
dist/foo.js
console.log("src/foo.js:1:13")1.0.3-09a3a57
8 months ago
1.0.3-3eb31c8
8 months ago
1.0.3-834ddf6
8 months ago
1.0.3-e49aeaa
9 months ago
1.0.3-c2540da
9 months ago
1.0.3-ac850f7
9 months ago
1.0.2
1 year ago
1.0.3-7a86828
1 year ago
1.0.2-87a5573
1 year ago
1.0.2-584352d
1 year ago
1.0.2-bd4fb9b
1 year ago
1.0.2-4aeaaeb
1 year ago
1.0.2-61945bf
1 year ago
1.0.2-09b489e
1 year ago
1.0.2-da830d6
1 year ago
1.1.0-c19b86f
2 years ago
1.0.1
2 years ago
1.1.0-dc49d97
2 years ago
1.1.0-8ab40b1
2 years ago
1.1.0-b757535
2 years ago
1.1.0-3e07890
2 years ago
1.1.0-185237b
2 years ago
1.1.0-3b03cf3
2 years ago
1.0.0
2 years ago
0.1.0-e0e08a2
2 years ago
1.1.0-43a2acc
2 years ago
0.1.0-72748da
2 years ago
0.0.1
2 years ago