Socket
Socket
Sign inDemoInstall

@gulp-sourcemaps/map-file

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gulp-sourcemaps/map-file

Gulp plugin for changing the file property of a sourcemap.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

@gulp-sourcemaps/map-file

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status

Gulp plugin for changing the file property of a sourcemap.

Example

var mapFile = require('@gulp-sourcemaps/map-file');

gulp.src(...)
  .pipe(sourcemaps.init())
  .pipe(sourcemaps.write())
  .pipe(mapFile(function(filePath, file) {
    return '../' + filePath;
  }))
  .pipe(gulp.dest(...))

API

mapFile(mapFn)

Takes a map function as the only argument. Returns an objectMode Transform stream.

mapFn(filePath, file)

The map function is called once per each Vinyl object passed through the stream that contains a sourcemap. The map function is called with the filePath string from the file property of the sourcemap and the file object it originated from. The return value replaces the original value.

If a Vinyl object doesn't have a sourceMap property, the file is passed through the stream without having the mapFn called. If the sourceMap.file property doesn't exist, filePath will be undefined.

All file properties are normalized to use / instead of \\ as path separators.

License

MIT

Keywords

FAQs

Package last updated on 24 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc