babel-plugin-sandstone-require
Babel plugin that adds Sandstone's h
declaration if file contains JSX tags.
This code was forked from babel-plugin-preact-require. Credit where credit is due
Example
Your component.js
that contains this code:
{ return <div /> }
will be transpiled into something like this:
{ /* this part will be transpiled by babel itself as usual */ return }
Usage
- Install
babel-plugin-sandstone-require
.
npm install babel-plugin-sandstone-require --save-dev
- Add
sandstone-require
into.babelrc
. This plugin should be defined before any module transforms plugin because it's using ES2015 modules syntax to import Sandstone'sh
into scope.