# gulp-react

> Precompile Facebook React JSX templates into JavaScript

Latest version **4.0.0** (published 2018-11-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install gulp-react
pnpm add gulp-react
yarn add gulp-react
bun add gulp-react
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2018-11-08 |
| First published | 2014-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 5 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 232 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | gulpplugin, react, jsx, transform, transformer, template, templates, view, views, precompile, compile |

## Links

- npm: https://www.npmjs.com/package/gulp-react
- Repository: https://github.com/sindresorhus/gulp-react
- Homepage: https://github.com/sindresorhus/gulp-react#readme
- Issues: https://github.com/sindresorhus/gulp-react/issues
- npm.io page: https://npm.io/package/gulp-react

## Dependencies (5)

- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.0
- [react-tools](https://npm.io/package/react-tools.md) ^0.13.0
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1
- [vinyl-sourcemaps-apply](https://npm.io/package/vinyl-sourcemaps-apply.md) ^0.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2018-11-08
- 3.1.0 — 2015-10-15
- 3.0.1 — 2015-03-12
- 3.0.0 — 2015-03-03
- 2.0.0 — 2014-10-29
- 1.0.2 — 2014-09-19
- 1.0.1 — 2014-09-13
- 1.0.0 — 2014-08-14
- 0.5.0 — 2014-07-20
- 0.4.0 — 2014-06-24
- 0.3.3 — 2014-04-26
- 0.3.2 — 2014-04-14
- 0.3.1 — 2014-03-28
- 0.3.0 — 2014-03-24
- 0.2.0 — 2014-02-23
- … 3 more at https://npm.io/package/gulp-react/versions

## README

# gulp-react [![Build Status](https://travis-ci.org/sindresorhus/gulp-react.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-react)

## Deprecated in favor of [gulp-babel](https://github.com/babel/gulp-babel). [Read more.](https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html)

> Precompile [React](http://facebook.github.io/react/) JSX templates into JavaScript

*Issues with the output should be reported on the React [issue tracker](https://github.com/facebook/react/issues).*


## Install

```
$ npm install --save-dev gulp-react
```


## Usage

```js
var gulp = require('gulp');
var react = require('gulp-react');

gulp.task('default', function () {
	return gulp.src('template.jsx')
		.pipe(react())
		.pipe(gulp.dest('dist'));
});
```


## API

### react([options])

See the `react-tools` [options](https://github.com/facebook/react/tree/master/npm-react-tools#transforminputstring-options), except for `sourceMap` and `sourceFilename`, which are handled for you.


## Source Maps

Use [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) like this:

```js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var react = require('gulp-react');

gulp.task('default', function () {
	return gulp.src('template.jsx')
		.pipe(sourcemaps.init())
		.pipe(react())
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('dist'));
});
```


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)

---
_Source: https://npm.io/package/gulp-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
