I got it working with gulp-sourcemaps:
gulp.src(src)
.pipe(sourcemaps.init()) // <-
and
return stream.done()
.pipe(concat(path.basename(options.outputFile), {newLine: ';\n'}))
.pipe(sourcemaps.write()) // <-
.pipe(gulp.dest(path.dirname(options.outputFile)));
This will of course work per extension and not when all the scripts are combined in the flarum-*.js file, but will do for the moment.