
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
vinyl-sourcemaps-apply
Advanced tools
Apply a source map to a vinyl file, merging it with preexisting source maps
Apply a source map to a vinyl file, merging it with preexisting source maps.
var applySourceMap = require('vinyl-sourcemaps-apply');
applySourceMap(vinylFile, sourceMap);
var through = require('through2');
var applySourceMap = require('vinyl-sourcemaps-apply');
var myTransform = require('myTransform');
module.exports = function(options) {
function transform(file, encoding, callback) {
// generate source maps if plugin source-map present
if (file.sourceMap) {
options.makeSourceMaps = true;
}
// do normal plugin logic
var result = myTransform(file.contents, options);
file.contents = new Buffer(result.code);
// apply source map to the chain
if (file.sourceMap) {
applySourceMap(file, result.map);
}
this.push(file);
callback();
}
return through.obj(transform);
};
The gulp-sourcemaps package is used to generate and write source maps in the Gulp build system. It provides more comprehensive functionality for handling source maps, including initializing, writing, and loading source maps. Compared to vinyl-sourcemaps-apply, gulp-sourcemaps offers a more integrated solution for source map management within Gulp tasks.
The source-map package is a library for generating and consuming source maps. It provides low-level APIs for creating and manipulating source maps. While vinyl-sourcemaps-apply focuses on applying source maps to vinyl files, source-map offers a broader range of functionalities for working with source maps directly.
FAQs
Apply a source map to a vinyl file, merging it with preexisting source maps
The npm package vinyl-sourcemaps-apply receives a total of 744,697 weekly downloads. As such, vinyl-sourcemaps-apply popularity was classified as popular.
We found that vinyl-sourcemaps-apply demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.