Gulp plugin for changing the file property of a sourcemap.
No LLMs for issues.
No LLMs for patches / pull requests.
No LLMs for comments on the bug tracker, including translation.
English is encouraged, but not required. You are welcome to post in your native language and rely on others to have their own translation tools of choice to interpret your words.
var mapFile = require('@gulp-sourcemaps/map-file');
gulp.src(...)
.pipe(sourcemaps.init())
.pipe(sourcemaps.write())
.pipe(mapFile(function(filePath, file) {
return '../' + filePath;
}))
.pipe(gulp.dest(...))Takes a map function as the only argument. Returns an objectMode Transform stream.
The map function is called once per each Vinyl object passed through the stream that contains a sourcemap. The map function is called with the filePath string from the file property of the sourcemap and the file object it originated from. The return value replaces the original value.
If a Vinyl object doesn't have a sourceMap property, the file is passed through the stream without having the mapFn called. If the sourceMap.file property doesn't exist, filePath will be undefined.
All file properties are normalized to use / instead of \\ as path separators.
MIT