Regardless of what I'm trying, something <div/>doesn't seem to convert to React.createClass, and the browser is clearly choking on the first <in my code.
I use gulp as:
return gulp.src(files)
.pipe(babel({
presets: [ "react", "es2015" ],
plugins: [ "transform-react-jsx" ]
}))
.pipe(gulp.dest(dest));
I tried with and without transform-react-jsx, because I believe that the preset reactshould also convert jsx?
This is mine .babelrc, but it does not seem to make any difference, and I read somewhere that in some cases you need to remove it to work. I tried, did not help.
{
"presets": [ "react", "es2015" ],
"plugins": ["transform-react-jsx"]
}
in my .json package:
"babel": "^6.5.2",
"babel-cli": "^6.8.0",
"babel-plugin-transform-react-jsx": "^6.8.0",
"babel-preset-es2015": "~6.5.0",
"babel-preset-react": "^6.5.0",
"gulp-babel": "~6.1.2",
...
I tried almost everything, but just does not change the code
source
share