BPTPI for short, pronounced Bipitipy
This plugin adds
import { h } from 'preact'
to files containing JSX
In
const Title = (value) => <h1>{value}</h1>
Out
import { h } from 'preact'
const Title = (value) => <h1>{value}</h1>
npm install --save-dev babel-plugin-transform-preact-import
{
"plugins": [
"transform-preact-import"
]
}
babel --plugins babel-plugin-transform-preact-import script.js
require("babel-core").transform("code", {
plugins: ["transform-preact-import"]
});