Socket
Socket
Sign inDemoInstall

babel-plugin-transform-rax-render-entry

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-rax-render-entry

Auto render entry App of Rax


Version published
Weekly downloads
8
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-rax-render-entry

Example

In

import { createElement } from "rax";
export default function App() {}

Out

import { createElement, render } from "rax";
import __driver from "driver-universal";
export default function App() {}
const __root = document.querySelector && document.querySelector('#root') || null;
const __hydrate = __root && __root.hasAttribute('data-hydrate') || false;
render(createElement(App), __root, { driver: __driver, hydrate: __hydrate });

Installation

$ npm install babel-plugin-transform-rax-render-entry

Usage

.babelrc

{
  "plugins": [
    ["transform-rax-render-entry", {
      "include": /my-entry\.js/,
      "root": "#root" // default #root
    }]
  ]
}
  • include: Required, paths of your entry files, can be regexp, array, string and function.

Via CLI

$ babel --plugins transform-rax-render-entry script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-rax-render-entry"]
});

Keywords

FAQs

Package last updated on 26 Mar 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc