How to use the vinyl-sourcemap.add function in vinyl-sourcemap

To help you get started, we’ve selected a few vinyl-sourcemap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gulpjs / vinyl-fs / lib / src / sourcemap.js View on Github external
function addSourcemap(file, enc, callback) {
    var srcMap = optResolver.resolve('sourcemaps', file);

    if (!srcMap) {
      return callback(null, file);
    }

    sourcemap.add(file, onAdd);

    function onAdd(sourcemapErr, updatedFile) {
      if (sourcemapErr) {
        return callback(sourcemapErr);
      }

      callback(null, updatedFile);
    }
  }

vinyl-sourcemap

Add/write sourcemaps to/from Vinyl files.

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis

Popular vinyl-sourcemap functions