I am successfully getting sourcemaps output from my build process which uses browserify with gulp. However, the sourcemaps don't work when debugging - breakpoints often jump to a different line when I set them (in Chrome), and it is clear the script is not actually pausing where it says it is. When I hover over variables to view their values, it shows the wrong thing, and so on. I used this tutorial as a basis, so it seems like it should work.
The relevant build step in my gulpfile.js is:
return browserify({
basedir: '.',
debug: mode === 'dev',
entries: [`${paths.src}/app/${buildConfig.appFolder}/${buildConfig.appSrc}`],
cache: {},
packageCache: {},
})
.plugin(tsify)
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest(`${paths.dist}/app/${buildConfig.appFolder}`))
.on('error', err => {
console.error(err.toString());
done(err);
});
And tsconfig.json is:
{
"compilerOptions": {
"lib": ["es2018", "dom"],
"target": "es2015",
"jsx": "react",
"moduleResolution": "node",
"diagnostics": true,
"types": [
"react",
"react-dom",
"lodash"
]
}
}