updated the docs regarding source maps with the fromString option issue #1192

This commit is contained in:
qyoz 2016-07-11 13:08:50 +03:00
parent b27e9655ad
commit 95f115f502

View File

@ -628,6 +628,14 @@ console.log(result.code); // minified output
console.log(result.map); console.log(result.map);
``` ```
To generate a source map with the fromString option, you can also use an object:
```javascript
var result = UglifyJS.minify({"file1.js": "var a = function () {};"}, {
outSourceMap: "out.js.map",
fromString: true
});
```
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]).