Friday 19 May 2017

Unexpected token error Gulp task

I'm trying to run a task in gulp and I'm having problems running on linux, can anyone help me check what it can be?

function jsTask() {
    return gulp.src('./frontend/src/js/**/*.js')
        .pipe(babel())
        .pipe(gulp.dvest('frontend/js'));
}

gulp.task('js', jsTask);
gulp.task('js-watch', () => {
    return watch('./frontend/src/js/**/*.js', { ignoreInitial: false }, jsTask);
});

function lessTask() {
    return gulp.src(['./frontend/src/less/*-main.less'])
        .pipe(less())
        .pipe(cleanCSS({ compatibility: 'ie8' }))
        .pipe(gulp.dest('./public/css'));
}

gulp.task('less', lessTask);
gulp.task('less-watch', () => {
    return watch('./frontend/src/less/**/*.less', { ignoreInitial: false }, lessTask);
});

gulp.task('default', ['js', 'less']);
gulp.task('watch', ['js-watch', 'less-watch']);

When I run the "gulp js" command, I get the following error below

events.js:160
      throw er; // Unhandled 'error' event
      ^
SyntaxError: /var/www/myproject/frontend/src/js/iframe.js: 
   9 |
  10 | export const routes = (
> 11 |     <Route path="" component={({children}) => (children) }>
     |     ^
  12 |         <Route path="/not-found" component={NotFoundPage} />



via Dennis

No comments:

Post a Comment