5 comments
Comment actions Permalink

Yes, sure. But the compiler you use to transpile ES6 to javascript should produce sourcemaps that conform to Source Map Spec (https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?hl=en_US), and the generated js file should have the properly formatted //@ sourceMappingURL comment

0
Comment actions Permalink

I am using Webstorm 9 with the traceur compiler. It is generating the map files correctly. If I use the chrome debugger, it works as expected and I am able to step through the ES6 js files.  However in Webstorm, when I start debugging, no breakpoints are ever hit (it does open up the page in chrome and I get the message ''JetBrains IDE Support is debugging this tab). I have set breakpoints in my ES6 js files and the generated js files. I feel like I am missing something, but I don't know what.

0
Comment actions Permalink

I too am having trouble getting breakpoints to work.  If I use WebStorm's babel file watcher everything works fine, but if I compile with babel-gulp, breakpoints are never hit.  It looks like the js and js.map files produced by babel-gulp are identical to the ones produced by the file watcher.  The only noticable difference is that the es6, js, and js.map files aren't grouped in the project tree when using babel-gulp.

Here is my gulp task for reference:

gulp.task('compile', function () {
    gulp.src(['plugin/**/*.es6'])
        .pipe(sourcemaps.init())
        .pipe(babel())
        .on('error', gutil.log)
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('plugin'))
});
0
Comment actions Permalink

Finally figured out what my problem was.  By default gulp-sourcemaps was appending an erroneous sourceRoot property of "source" at the end of the .js.map files.  The following fixed it:

gulp.src(['plugin/**/*.es6'])
    .pipe(sourcemaps.init())
    .pipe(babel())
    .on('error', gutil.log)
    .pipe(sourcemaps.write('.', {
        includeContent: false,
        sourceRoot
: '.'
    
}))
    .pipe(gulp.dest('plugin'))
0
Comment actions Permalink

Thanks a log Mark Brocato.

0

Please sign in to leave a comment.