Document passing source maps directly to minify() using inSourceMap

This commit is contained in:
David Caldwell
2015-04-03 17:27:28 -07:00
parent 94205c3a37
commit 2850dc69fd

View File

@@ -591,6 +591,16 @@ var result = UglifyJS.minify("compiled.js", {
// same as before, it returns `code` and `map`
```
If your input source map is not in a file, you can pass it in as an object
using the `inSourceMap` argument:
```javascript
var result = UglifyJS.minify("compiled.js", {
inSourceMap: JSON.parse(my_source_map_string),
outSourceMap: "minified.js.map"
});
```
The `inSourceMap` is only used if you also request `outSourceMap` (it makes
no sense otherwise).