gulp-sourcemaps
Advanced tools
Comparing version 1.1.5 to 1.2.0
@@ -207,2 +207,6 @@ 'use strict'; | ||
comment = comment.replace('\\', '/'); | ||
if (options.sourceMappingURLPrefix) { | ||
comment = comment.replace(/sourceMappingURL=\.*/, 'sourceMappingURL=' + options.sourceMappingURLPrefix); | ||
} | ||
} | ||
@@ -209,0 +213,0 @@ |
{ | ||
"name": "gulp-sourcemaps", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"description": "Source map support for Gulp.js", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/floridoo/gulp-sourcemaps", |
@@ -25,3 +25,3 @@ ## gulp-sourcemaps [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] | ||
All 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). | ||
All plugins between `sourcemaps.init()` and `sourcemaps.write()` need to have support for `gulp-sourcemaps`. You can find a list of such plugins in the [wiki](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support). | ||
@@ -137,2 +137,22 @@ | ||
- `sourceMappingURLPrefix` | ||
Specify a prefix to be prepended onto the source map URL when writing external source maps. Relative paths will have their leading dots stripped. | ||
Example: | ||
```javascript | ||
gulp.task('javascript', function() { | ||
var stream = gulp.src('src/**/*.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(concat('all.js')) | ||
.pipe(uglify()) | ||
.pipe(sourcemaps.write('../maps', { | ||
sourceMappingURLPrefix: 'https://asset-host.example.com/assets' | ||
})) | ||
.pipe(gulp.dest('public/scripts')); | ||
}); | ||
``` | ||
This will result in source mapping URL comment like `sourceMappingURL=https://asset-host.example.com/assets/maps/helloworld.js.map`. | ||
### Plugin developers only: How to add source map support to plugins | ||
@@ -139,0 +159,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14223
184
202