Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

bash-archive/babel-plugin-transform-preact-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-transform-preact-import

BPTPI for short, pronounced Bipitipy

Build and Test

This plugin adds import { h } from 'preact' to files containing JSX

Example

In

const Title = (value) => <h1>{value}</h1>

Out

import { h } from 'preact'
const Title = (value) => <h1>{value}</h1>

Installation

npm install --save-dev babel-plugin-transform-preact-import

Usage

Via .babelrc (Recommended)

{
  "plugins": [
    "transform-preact-import"
  ]
}

Via CLI

babel --plugins babel-plugin-transform-preact-import script.js

Via Node API

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

About

Imports preact for files containing jsx

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published