{
  "name": "gulp-sourcemaps",
  "version": "1.1.1",
  "description": "Source map support for Gulp.js",
  "homepage": "http://github.com/floridoo/gulp-sourcemaps",
  "repository": {
    "type": "git",
    "url": "git://github.com/floridoo/gulp-sourcemaps.git"
  },
  "main": "index.js",
  "scripts": {
    "test": "jshint *.js test/*.js && faucet test/*.js",
    "tap": "node node_modules/argg test/*.js",
    "cover": "istanbul cover --dir reports/coverage node_modules/argg test/*.js",
    "coveralls": "istanbul cover node_modules/argg test/*.js --report lcovonly && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
  },
  "keywords": [
    "gulpplugin",
    "gulp",
    "source maps",
    "sourcemaps"
  ],
  "author": {
    "name": "Florian Reiterer",
    "email": "me@florianreiterer.com"
  },
  "license": "ISC",
  "dependencies": {
    "through2": "^0.5.1",
    "vinyl": "^0.2.3",
    "convert-source-map": "^0.3.3"
  },
  "devDependencies": {
    "jshint": "^2.5.2",
    "tape": "^2.13.3",
    "argg": "0.0.1",
    "istanbul": "^0.3.0",
    "faucet": "0.0.1",
    "coveralls": "^2.11.1"
  },
  "readme": "## gulp-sourcemaps  [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]\n\n### Usage\n\n#### Inline maps\nInline maps are embedded in the source file.\n\nExample:\n```javascript\nvar gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\nvar sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('javascript', function() {\n  gulp.src('src/**/*.js')\n    .pipe(sourcemaps.init())\n      .pipe(concat('all.js'))\n      .pipe(uglify())\n    .pipe(sourcemaps.write())\n    .pipe(gulp.dest('dist'));\n});\n```\n\nAll plugins between `sourcemaps.init()` and `sourcemaps.write()` need to support source maps. You can find a list of such plugins in the [wiki](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support).\n\n\n#### External source map files\n\nTo write external source map files, pass a path relative to the destination to `sourcemaps.write()`.\n\nExample:\n```javascript\nvar gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\nvar sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('javascript', function() {\n  gulp.src('src/**/*.js')\n    .pipe(sourcemaps.init())\n      .pipe(concat('all.js'))\n      .pipe(uglify())\n    .pipe(sourcemaps.write('../maps'))\n    .pipe(gulp.dest('dist'));\n});\n```\n\n#### Load existing source maps\n\nTo load existing source maps, pass the option `loadMaps: true` to `sourcemaps.init()`.\n\nExample:\n```javascript\nvar gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\nvar sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('javascript', function() {\n  gulp.src('src/**/*.js')\n    .pipe(sourcemaps.init({loadMaps: true}))\n      .pipe(concat('all.js'))\n      .pipe(uglify())\n    .pipe(sourcemaps.write())\n    .pipe(gulp.dest('dist'));\n});\n```\n\n\n### Init Options\n\n- `loadMaps`\n  Set to true to load existing maps for source files. Supports the following:\n    - inline source maps\n    - source map files referenced by a `sourceMappingURL=` comment\n    - source map files with the same name (plus .map) in the same directory\n\n### Write Options\n\n- `addComment`\n\n  By default a comment containing / referencing the source map is added. Set this to `false` to disable the comment (e.g. if you want to load the source maps by header).\n\n  Example:\n  ```javascript\n  gulp.task('javascript', function() {\n    var stream = gulp.src('src/**/*.js')\n      .pipe(sourcemaps.init())\n        .pipe(concat('all.js'))\n        .pipe(uglify())\n      .pipe(sourcemaps.write('../maps', {addComment: false}))\n      .pipe(gulp.dest('dist'));\n  });\n  ```\n\n- `includeContent`\n\n  By default the source maps include the source code. Pass `false` to use the original files.\n\n  Including the content is the recommended way, because it \"just works\". When setting this to `false` you have to host the source files and set the correct `sourceRoot`.\n\n- `sourceRoot`\n\n  Set the path where the source files are hosted (use this when `includeContent` is set to `false`). This is an URL (or subpath) relative to the source map, not a local file system path. If you have sources in different subpaths, an absolute path (from the domain root) pointing to the source file root is recommended, or define it with a function.\n\n  Example:\n  ```javascript\n  gulp.task('javascript', function() {\n    var stream = gulp.src('src/**/*.js')\n      .pipe(sourcemaps.init())\n        .pipe(concat('all.js'))\n        .pipe(uglify())\n      .pipe(sourcemaps.write({includeContent: false, sourceRoot: '/src'}))\n      .pipe(gulp.dest('dist'));\n  });\n  ```\n\n  Example (using a function):\n  ```javascript\n  gulp.task('javascript', function() {\n    var stream = gulp.src('src/**/*.js')\n      .pipe(sourcemaps.init())\n        .pipe(concat('all.js'))\n        .pipe(uglify())\n      .pipe(sourcemaps.write({\n        includeContent: false,\n        sourceRoot: function(file) {\n          return '/src';\n        }\n       }))\n      .pipe(gulp.dest('dist'));\n  });\n  ```\n\n### Plugin developers only: How to add source map support to plugins\n\n- Generate a source map for the transformation the plugin is applying\n- **Important**: Make sure the paths in the generated source map (`file` and `sources`) are relative to `file.base` (e.g. use `file.relative`).\n- Apply this source map to the vinyl `file`. E.g. by using [vinyl-sourcemaps-apply](https://github.com/floridoo/vinyl-sourcemaps-apply).\n  This combines the source map of this plugin with the source maps coming from plugins further up the chain.\n- Add your plugin to the [wiki page](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support)\n\n#### Example:\n\n```javascript\nvar through = require('through2');\nvar applySourceMap = require('vinyl-sourcemaps-apply');\nvar myTransform = require('myTransform');\n\nmodule.exports = function(options) {\n\n  function transform(file, encoding, callback) {\n    // generate source maps if plugin source-map present\n    if (file.sourceMap) {\n      options.makeSourceMaps = true;\n    }\n\n    // do normal plugin logic\n    var result = myTransform(file.contents, options);\n    file.contents = new Buffer(result.code);\n\n    // apply source map to the chain\n    if (file.sourceMap) {\n      applySourceMap(file, result.map);\n    }\n\n    this.push(file);\n    callback();\n  }\n\n  return through.obj(transform);\n};\n```\n\n[npm-image]: https://img.shields.io/npm/v/gulp-sourcemaps.svg?style=flat\n[npm-url]: https://npmjs.org/package/gulp-sourcemaps\n[travis-image]: https://img.shields.io/travis/floridoo/gulp-sourcemaps.svg?style=flat\n[travis-url]: https://travis-ci.org/floridoo/gulp-sourcemaps\n[coveralls-image]: https://img.shields.io/coveralls/floridoo/gulp-sourcemaps.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/floridoo/gulp-sourcemaps?branch=master\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/floridoo/gulp-sourcemaps/issues"
  },
  "_id": "gulp-sourcemaps@1.1.1",
  "_from": "gulp-sourcemaps@^1.0.0"
}
