1

For my TypeScript project I'm using BrowserSync to check results of my work. I'm trying to log some of my application states via console.log in a TypeScript code.

My Gulp tasks:

gulp.task('watch', ['browserSync'], function (){
  gulp.watch('app/scss/**/*.scss', ['sass']); 
  gulp.watch(paths.tscripts.src, ['compile']);
  gulp.watch('app/*.html', browserSync.reload);
  gulp.watch('app/js/**/*.js', browserSync.reload); 
});

gulp.task('browserSync', function() {
  browserSync.init({
    server: {
      baseDir: 'app'
    },
  })
});

I don't get any feedback neither from a Windows cmd (in which I'm running the Gulp 'watch' task) nor in a browser console (in a DevTools [F12])

What is the default target for a console.log and how can I set it up to work?

Chris Jaga
  • 389
  • 4
  • 17

1 Answers1

0

I was mislead. The problem was with my code, not with the console.log. The compiler didn't alert me that there is something wrong with my code - I've worked on JSON parser. My app just stopped processing the JSON file without any feedback - code was compiling but incorrect. Now as I fixed the parser, the comments from the console.log normally appear in the browser DevTools.

Chris Jaga
  • 389
  • 4
  • 17