
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
@gulp-sourcemaps/identity-map
Advanced tools
Gulp plugin for generating an identity sourcemap for a file.
@gulp-sourcemaps/identity-map is a Gulp plugin that generates a source map for a file by assuming the file content is the result of a transformation. It is useful for cases where you want to generate source maps for files that have already been transformed by other tools.
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'));
});
gulp-sourcemaps is a Gulp plugin that allows you to generate source maps for various types of files. It provides more flexibility and options compared to @gulp-sourcemaps/identity-map, as it can be used with a variety of other Gulp plugins to generate source maps for different types of transformations.
gulp-uglify is a Gulp plugin that minifies JavaScript files. While its primary purpose is not to generate source maps, it can be used in conjunction with gulp-sourcemaps to generate source maps for minified files. This makes it a complementary tool to @gulp-sourcemaps/identity-map when working with minified JavaScript.
gulp-babel is a Gulp plugin that transpiles ES6+ JavaScript to ES5 using Babel. It can be used with gulp-sourcemaps to generate source maps for the transpiled code. This makes it a useful tool for generating source maps for JavaScript files that have been transformed by Babel, similar to @gulp-sourcemaps/identity-map.
Gulp plugin for generating an identity sourcemap for a file.
var identityMap = require('@gulp-sourcemaps/identity-map');
gulp.src(...)
.pipe(sourcemaps.init())
.pipe(identityMap()) // .js and .css files will get a generated sourcemap
.pipe(sourcemaps.write())
.pipe(gulp.dest(...))
identityMap()
Returns an objectMode
Transform stream that processes each file with a .sourceMap
property and buffered contents. A sourcemap is generated and attached for each .js
and .css
file.
MIT
FAQs
Gulp plugin for generating an identity sourcemap for a file.
We found that @gulp-sourcemaps/identity-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.