I'm trying to combine both JS and JSX files (to use with React.js) in a single, versioned all.js file.
My current Gulpfile:
var elixir = require('laravel-elixir');
elixir.config.sourcemaps = false;
elixir(function(mix) {
mix
.less([
'app.less'
], null, 'resources/assets/less')
.babel([
'libs/**', //contains react.js among other libs (jquery, bootstrap)
'app.js', //contains normal jquery
'quiz/quiz.jsx'
], null, 'resources/assets/js')
//.babel([
//'quiz/quiz.jsx'
//])
.version(["css/app.css", "js/all.js"]);
});
Output:
[18:38:28] Starting 'default'...
[18:38:28] Starting 'less'...
Fetching Less Source Files...
- resources/assets/less/app.less
Saving To...
- public/css/app.css
[18:38:30] Finished 'default' after 1.91 s
[18:38:34] gulp-notify: [Laravel Elixir] Less Compiled!
[18:38:34] Finished 'less' after 6 s
[18:38:34] Starting 'babel'...
Fetching Babel Source Files...
- resources/assets/js/libs/**/**/*
- resources/assets/js/app.js
- resources/assets/js/quiz/quiz.jsx
Saving To...
- public/js/all.js <---- STUCK HERE
It's been stuck there for a while and I'm not sure how to debug this.
Changing the first babel() with scripts() works, but of course won't compile the JSX file (and won't complain about it).
Calling babel after scripts (the 3 commented out lines) will correctly compile the JSX file, but without everything else (it will simply compile the JSX and save it to all.js).
How can I fix this?