0.2.1 • Published 9 years ago

vinyl-sourcemaps-apply v0.2.1

Weekly downloads
956,361
License
ISC
Repository
github
Last release
9 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-3056@selfisekai/gulp-sass@stone-payments/gulp-ng-annotate@tiaanduplessis/gulp-prettier-eslint@tmsfe/tmskit@sequencemedia/gulp-clean-css@sequencemedia/gulp-postcss@sequencemedia/gulp-sass@spomni/gulp-dart-sass@wabson/gulp-include@yzfe/gulp-sass@yproximite/yprox-cliapeman-task-closurecompileralisselisss-lab3amd-optimizeamd-optimize-babelathena-betaathena-htmlbalm-corebuildozerct-mapapps-gulp-jsfas-sassfenglin-uploaderejsv3fncjsfishzeroflint-gulp-babelflint-gulp-reactflint-runnerflintfp-stylusgulp-cjsxgulp-clean-cssgulp-cleaner-cssgulp-combinegulp-codekit-extendedgulp-coffee-react-voidgulp-coffee-voidgulp-coffee2gulp-coffeescriptgulp-cnsgulp-codekitgulp-coffeegulp-coffee-reactgulp-amd-optimizegulp-amdcleangulp-amdcleanergulp-6to5gulp-accordgulp-dumber-css-modulegulp-es6mtgulp-es6to5gulp-esnextgulp-editor-stylesgulp-es6-module-transpilergulp-es6-imports-renamergulp-esperantogulp-esperanto-rocksgulp-espowergulp-html-to-templategulp-istanbulgulp-istanbul-espreegulp-javascript-obfuscator-fixedgulp-jsccgulp-jspm-buildergulp-eagle-rollupgulp-earlgulp-lightningcssgulp-packagingjsgulp-less-legacygulp-library-umdgulp-latte-coffeegulp-lessgulp-lispyscriptgulp-less-watchergulp-less-devgulp-lpmotor-jswrapgulp-lsgulp-livescriptgulp-livescript-asyncgulp-livescript-nextgulp-livescript-pass-errorgulp-mammouthgulp-extract-css-urlsgulp-iconifygulp-iconify-reloadedgulp-iifegulp-includegulp-include-2gulp-include-altgulp-include-extgulp-include-extend
0.2.1

9 years ago

0.2.0

9 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago