From 95f115f50201f7a5517ff878a995006f970e7d24 Mon Sep 17 00:00:00 2001 From: qyoz Date: Mon, 11 Jul 2016 13:08:50 +0300 Subject: [PATCH] updated the docs regarding source maps with the fromString option issue #1192 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0d6e619a..04b0799e 100644 --- a/README.md +++ b/README.md @@ -628,6 +628,14 @@ console.log(result.code); // minified output 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 `result.map`. The value passed for `outSourceMap` is only used to set the `file` attribute in the source map (see [the spec][sm-spec]).