Buckets:
1.72 GB
20,066 files
Updated 2 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| node_modules | 19 items | ||
| package.json | 607 Bytes xet | 1c837832 | |
| index.js | 1.37 kB xet | 0edcd6cf | |
| README.md | 939 Bytes xet | cfe962b2 | |
| .npmignore | 22 Bytes xet | 957489a1 | |
| .jshintrc | 34 Bytes xet | fc21b049 |
vinyl-sourcemaps-apply
Apply a source map to a vinyl file, merging it with preexisting source maps.
Usage:
var applySourceMap = require('vinyl-sourcemaps-apply');
applySourceMap(vinylFile, sourceMap);
Example (Gulp plugin):
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);
};
- Total size
- 1.72 GB
- Files
- 20,066
- Last updated
- May 12
- Pre-warmed CDN
- US EU US EU