@best-shot/preset-react

A best-shot preset for react project.

Usage no npm install needed!

<script type="module">
  import bestShotPresetReact from 'https://cdn.skypack.dev/@best-shot/preset-react';
</script>

README

@best-shot/preset-react logo

A best-shot preset for react project.

npm github node

This preset offer the following features:

  • React framework and JSX syntax support.
  • Use react-refresh to support hot module reload.
  • Remove react/airbnb propTypes in production mode.
  • JSX syntax in typescript: *.tsx

Installation

npm install @best-shot/preset-react --save-dev

Usage

// example: .best-shot/config.mjs
export default {
  presets: ['babel', 'react']
};

Tips

This preset contains some optimization transform. It is not 100% safe, you can enable them manually.

// example: babel.config.json
{
  "plugins": ["@babel/transform-react-constant-elements"]
}

Related