Merge a0dd59fe84 into fcde6109b0
This commit is contained in:
commit
7d703cb357
10
README.md
10
README.md
|
|
@ -581,7 +581,15 @@ console.log(result.map);
|
||||||
|
|
||||||
Note that the source map is not saved in a file, it's just returned in
|
Note that the source map is not saved in a file, it's just returned in
|
||||||
`result.map`. The value passed for `outSourceMap` is only used to set the
|
`result.map`. The value passed for `outSourceMap` is only used to set the
|
||||||
`file` attribute in the source map (see [the spec][sm-spec]).
|
`file` attribute in the source map (see [the spec][sm-spec]). The value set
|
||||||
|
in the `//# sourceMappingURL` comment defaults to `outSourceMap`, but this
|
||||||
|
can be overridden by setting the `sourceMapURL` parameter:
|
||||||
|
```javascript
|
||||||
|
var result = UglifyJS.minify([ "file1.js", "file2.js", "file3.js" ], {
|
||||||
|
outSourceMap: "out.js.map",
|
||||||
|
sourceMapURL: "sourcemaps/out.js.map",
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
You can also specify sourceRoot property to be included in source map:
|
You can also specify sourceRoot property to be included in source map:
|
||||||
```javascript
|
```javascript
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ exports.minify = function(files, options) {
|
||||||
outSourceMap : null,
|
outSourceMap : null,
|
||||||
sourceRoot : null,
|
sourceRoot : null,
|
||||||
inSourceMap : null,
|
inSourceMap : null,
|
||||||
|
sourceMapURL : null,
|
||||||
fromString : false,
|
fromString : false,
|
||||||
warnings : false,
|
warnings : false,
|
||||||
mangle : {},
|
mangle : {},
|
||||||
|
|
@ -132,7 +133,7 @@ exports.minify = function(files, options) {
|
||||||
toplevel.print(stream);
|
toplevel.print(stream);
|
||||||
|
|
||||||
if(options.outSourceMap){
|
if(options.outSourceMap){
|
||||||
stream += "\n//# sourceMappingURL=" + options.outSourceMap;
|
stream += "\n//# sourceMappingURL=" + (options.sourceMapURL || options.outSourceMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
var source_map = output.source_map;
|
var source_map = output.source_map;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user