babel-plugin-transform-jsx-fragment
Last updated 2 years ago by rax-publisher .
Original npm · Tarball · package.json
$ npm install babel-plugin-transform-jsx-fragment 
SYNC missed versions from official npm registry.

babel-plugin-transform-jsx-fragment

Example

In

export default function Foo() {
  return (<Fragment></Fragment>);
}

Out

import { Fragment } from "rax";

export default function Foo() {
  return <Fragment></Fragment>;
}

Installation

$ npm install babel-plugin-transform-jsx-fragment

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": [
    ["transform-jsx-fragment", {
      "moduleName": "preact",
      "ignoreModuleCheck": false,
    }]
  ]
}
  • moduleName: String, Optional, import module name, default to 'rax'.
  • ignoreModuleCheck: Boolean, Optional, ignore checking the imported Fragment from same moduleName, default to false.

Via CLI

$ babel --plugins transform-jsx-fragment script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-jsx-fragment"]
});

Current Tags

  • 0.1.3-0                                ...           beta (5 years ago)
  • 0.1.5                                ...           latest (2 years ago)

7 Versions

  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.3-0                                ...           5 years ago
  • 0.1.2-0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)

© 2010 - cnpmjs.org x YWFE | Home | YWFE