Generate Source Maps
This feature allows you to generate source maps for JavaScript files. The code sample demonstrates how to use the @gulp-sourcemaps/identity-map plugin in a Gulp task to generate source maps for all JavaScript files in the 'src' directory and output them to the 'dist' directory.
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const identityMap = require('@gulp-sourcemaps/identity-map');
gulp.task('sourcemap', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(identityMap())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});