0.4.10 • Published 5 years ago
babel-plugin-react-server v0.4.10
babel-plugin-react-server
React Server transpilation
Example
In
var logger = require('react-server').logging.getLogger(__LOGGER__);
Out
"use strict";
var logger = require('react-server').logging.getLogger({ name: 'module.name', color: {} });
Installation
$ npm install babel-plugin-react-server
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["react-server"]
}
Via CLI
$ babel --plugins react-server script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["react-server"]
});
Configuration
A fully configured babel plugin in your babelrc would look be
{
"plugins": [
["react-server", {
"trim": "my-project.components.",
"token": "__LOGGER__"
}]
]
}
Trim
A substring to trim off the front of the module name
{
trim: "my-project.pages."
}
Token
The token to replace in the source code with the module tag. By default, uses
the default logger token __LOGGER__
, and two future reserved tokens,
__CHANNEL__
and
{
token: "__LOGGER__"
}
1.0.0-alpha.2
5 years ago
1.0.0-alpha.1
5 years ago
1.0.0-alpha.0
6 years ago
0.6.0
8 years ago
0.4.10
8 years ago
0.4.7
8 years ago
0.4.4
8 years ago
0.3.3
8 years ago
0.0.1
8 years ago