0.2.1 • Published 10 years ago

vinyl-sourcemaps-apply v0.2.1

Weekly downloads
956,361
License
ISC
Repository
github
Last release
10 years ago

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);
};
@sooha/cliaccra-autoprefixeraccra-minify-cssaccra-balelaccra-sassaccra-uglifygulp-babel-simple-transpilegulp-closure-css-renamer@everything-registry/sub-chunk-3056tapc-parse-depterminadorweb-component-uiwxywebvst-gulp-cssimportvideo-multi-uploadervue-cvs@blakedarlin/gulp-sassjeuxuilaravel-bassetillumpraesentiumgulp-less-watchergulp-library-umdgulp-lpmotor-jswrapgulp-lsgulp-livescriptgulp-livescript-asyncgulp-livescript-nextgulp-livescript-pass-errorgulp-mammouthgulp-pixremgulp-pixrem2gulp-pleeeasegulp-parablegulp-monicgulp-minify-cssgulp-minify-css-mpathgulp-native-stylusgulp-reworkgulp-rollup-eachgulp-rollup-plugingulp-rollup-streamgulp-rollup-2gulp-rucksackgulp-rtlcssgulp-modify-css-urlsgulp-minify-template-inlinegulp-jspm-buildergulp-lightningcssgulp-lispyscriptgulp-polymer-postcssgulp-postcssgulp-postcss-hover-media-groupergulp-postcss-rtlcssgulp-plugin-tersergulp-polymer-babelgulp-normalize-html-for-requiregulp-sass-monstergulp-sass-newergulp-sass-nextgulp-sass-no-nodesassgulp-sass-portal-variablesgulp-sass-vendorgulp-sass-cdngulp-sass-changbagulp-sass-chinagulp-sass-extendedgulp-sassygulp-sassgulp-australian-stylesheetsgulp-best-rollupgulp-best-rollup-2gulp-better-rollupgulp-better-rollup2gulp-babelgulp-babel-2gulp-babelcachegulp-css-preprocessorgulp-cssimportgulp-atsgulp-html-postcssgulp-6to5gulp-accordgulp-ifdefgulp-iifegulp-iconifygulp-iconify-reloadedgulp-inline-ng2-templategulp-includegulp-include-2gulp-include-extgulp-include-extendgulp-prepack-jsgulp-prettier-eslintgulp-prettiestgulp-ractive-foundationgulp-pure-cjsgulp-purgecssgulp-coffeescriptgulp-combinegulp-coffee
0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago