Gulp plugin for loading or clearing sources content of a sourcemap.
Last updated 2 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @gulp-sourcemaps/sources-content 
SYNC missed versions from official npm registry.


NPM version Downloads Build Status AppVeyor Build Status Coveralls Status

Gulp plugin for loading or clearing sources content of a sourcemap.


Sources content is loaded by default during sourcemaps.write() but this may be too late. This module allows sources content to be loaded before using @gulp-sourcemaps/map-sources to rewrite using URL's that might not be valid on the filesystem.

var mapSources = require('@gulp-sourcemaps/map-sources');
var sourcesContent = require('@gulp-sourcemaps/sources-content');

  .pipe(mapSources(function(sourcePath, file) {
    return '../' + sourcePath;



Takes a object containing options for this plugin.


Seting this option true will cause the sources content to be deleted instead of initialized.

A function can be passed for clear, this allows removing sources content associated with some files but not others. The function is called with filename argument for each source, returning true causes the contents for that file to be cleared.

  /* ... */
    clear: function(filename, mainFile) {
      /* Clear all sourceContent elements except the one
       * associated with sourceMap.file. */
      return filename !== mainFile



Current Tags

  • 1.1.0                                ...           latest (2 years ago)

2 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Today 2
This Week 2
This Month 3
Last Day 0
Last Week 1
Last Month 3
Dependencies (2)
Dev Dependencies (8)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |