0.2.1 • Published 8 years ago

vinyl-sourcemaps-apply v0.2.1

Weekly downloads
956,361
License
ISC
Repository
github
Last release
8 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-renamergoogle-closure-compiler@everything-registry/sub-chunk-3056gulp-reworkgulp-unassertlfagulp-autoprefixergulp-atsgulp-australian-stylesheetsgulp-butternutgulp-clean-cssgulp-cjsxgulp-cleaner-cssgulp-cnsgulp-amd-optimizegulp-amdcleangulp-amdcleanergulp-angular-componentsgulp-arnoldcgulp-babelgulp-babel-2gulp-babel-depsgulp-babel-extendedgulp-babel-globalsgulp-babel-minifygulp-best-rollupgulp-best-rollup-2gulp-better-rollupgulp-better-rollup2gulp-better-rollup3gulp-babel2gulp-babel5gulp-babelcachegulp-babiligulp-accordgulp-bmn-sassgulp-browserify-wrapgulp-bublegulp-bucklescriptgulp-blackcoffeegulp-blessgulp-bless-improved-cachebustinggulp-codekitgulp-codekit-extendedgulp-coffee-reactgulp-coffee-react-voidgulp-coffee-voidgulp-coffee2gulp-coffeescriptgulp-combinegulp-coffeegulp-continuationgulp-css-preprocessorgulp-6to5gulp-dumber-css-modulegulp-eagle-rollupgulp-earlgulp-editor-stylesgulp-flexiegulp-csso-updategulp-csso-updatedgulp-dereservegulp-decodecodegulp-extract-css-urlsgulp-group-concatgulp-group-concat-ordergulp-gorillagulp-dart-sassgulp-dart-scssgulp-cssimportgulp-cssimport-extgulp-cssnanogulp-cssogulp-es6mtgulp-es6to5gulp-es6-imports-renamergulp-es6-module-transpilergulp-esnextgulp-esperantogulp-esperanto-rocksgulp-espowergulp-haxegulp-header-commentgulp-header-comment-vdxgulp-istanbul-espreegulp-istanbulgulp-inline-ng2-templategulp-iconifygulp-iconify-reloadedgulp-iifegulp-ifdefgulp-javascript-obfuscator-fixedgulp-html-postcss
0.2.1

8 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