0

Hi guys I have a problem when I try to launch the command "gulp" from Terminal.

My gulpfile.js is:

var gulp = require('gulp');

gulp.task('default',function() {

    console.log("Io sto per imparare ad usare React.js");

}); 
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');


gulp.task('default', function() {

        return browserify('./source/app.js')
                   .transform(babelify)
                     .bundle()
                     .pipe(source('snapterest.js'))
                     .pipe(gulp.dest('./build/'));

});

and When i try to launch the 'gulp' command:

enter image description here

My app.js file is:

var React = require('react');
var ReactDOM = require('react-dom');

var Application = require('./components/Application.react');

ReactDOM.render(<Application />, document.getElementById('react-application'));

I am very grateful if someone can help me to find out a solution.

Emilio
  • 89
  • 1
  • 12
  • This will probably help: https://stackoverflow.com/questions/44267369/reactjs-module-build-failed-syntaxerror-unexpected-token-reactdom-render – Robbie Oct 14 '18 at 13:03
  • Possible duplicate of [ReactJS Module build failed: SyntaxError: Unexpected token - ReactDOM.render](https://stackoverflow.com/questions/44267369/reactjs-module-build-failed-syntaxerror-unexpected-token-reactdom-render) – Robbie Oct 14 '18 at 13:03
  • But I cannot fint a webpack.config file in my project. How can I add one? – Emilio Oct 14 '18 at 13:08
  • If that's the solution you need, just create the webpack.config file in the root. ReactJS uses Webpack as part of the build so it should just pull it in if it exists. – Robbie Oct 14 '18 at 13:17

0 Answers0