gulp-jsx2example@2.0.0

EXAMPLES

README.md

gulp-jsx2example

npm version npm download

Compile JSX file to HTML (REPL)

Usage

return gulp
  .src(sourceFiles)
  .pipe(jsx2example(options[, updateWebapckConfig(config):Object]));

Options

{
  readme: 'README.md',      // readme file name, content will be render to index.html
  package: 'package.json',  // package file name, access repository information 
  cwd: process.cwd(),
  externalReact: false,     // when `true` don't bundle *react* *react-dom* library, 
                            // speed up webpack compiler time
  production: false         
}

If production true, Will replace gulp entry files content match :

pkg is equal to the options.package

Example

You can reference this repository gulpfile.js

The examples floder published to http://react-component.github.io/gulp-jsx2example/

var jsx2example = require('gulp-jsx2example')

gulp.task('examples', ['clean:site'], function(){
  return gulp
    .src(['./examples/*.*'])
    .pipe(jsx2example()) // jsx2example(options)
    .pipe(gulp.dest('site/examples/'))
})
./
examples
├── es6module.jsx
├── jsfile.js
└── jsxfile.jsx

after

./
site
├── examples
│   ├── common.css
│   ├── common.js
│   ├── es6module.html
│   ├── index.html
│   ├── jsfile.html
│   └── jsxfile.html
└── index.html
examples
├── es6module.jsx
├── jsfile.js
└── jsxfile.jsx

Publish

gh-pages -d site

https://www.npmjs.com/package/gh-pages

Fork me on GitHub