backbone + react +requirejs + gulp
package.json
devDependencies:{
"gulp-babel": "^6.1.2",
"babel-plugin-transform-react-jsx": "^6.8.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0"
}
gulp
var babel = require('gulp-babel')
gulp.task('babeljsx', function () {
return gulp.src( __('{{ app }}{{ jsFolder }}/_babelTest/*.js'))
.pipe(babel())
.pipe(gulp.dest( __('{{ app }}{{ jsFolder }}/_babelTest/output')));
});
requirejs
path: {
// react
react: '../components/react/react',
reactDOM: '../components/react/react-dom',
es6: '../components/requirejs-babel/es6',
babel: '../components/requirejs-babel/babel-5.8.34.min',
}
backbone route + react
ReactDom.render(