babel-plugin-inline-json-config-values
v1.0.0
Published
Inline values from a JSON file eg. a config file
Downloads
9
Maintainers
Readme
babel-plugin-inline-json-config-values
Inline values from a JSON file eg. a config file
Example
config.json:
{
"foo": "bar"
}
In
var foo = require('config').foo;
Out
var foo = "bar";
Installation
$ npm install babel-plugin-inline-json-config-values
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": [["inline-json-config-values", {"matchPattern": "config"}]]
}
Via CLI
$ babel --plugins inline-json-config-values script.js
Via Node API
require("babel-core").transform("code", {
"plugins": [["inline-json-config-values", {"matchPattern": "config"}]]
});