New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-react-server

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-server

Babel plugin for React Server transpilation

0.4.10
latest
Source
npm
Version published
Weekly downloads
2
-71.43%
Maintainers
3
Weekly downloads
 
Created
Source

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

.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__"
}

Keywords

react

FAQs

Package last updated on 08 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts