Hi, @matthewp. I know how to generate sourcemaps, we use it. But something seems wrong.
I’ve investigated a little more and this is what I found:
This is my main.js
throwing an error at line 3 (foo is undefined):
'use strict';
const a = window.foo.length;
for(let i = 0; i < 10; i++) {
console.log(i);
}
If I build it with minify: false
and sourceMaps: false
the error in the console leads me to the right position.

If I build with sourceMaps: true
The error message says it fails at line 5.
But at line 5 (sourcemapped main.js) is the for loop and not the error.

Hope that clarifies the issue.