aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
author1111hui <26634873@qq.com>2016-10-29 15:55:47 +0800
committerRichard van Velzen <rvanvelzen1@gmail.com>2016-11-29 20:29:12 +0100
commita7b3b0d3a55e2c48b63102dd111f27f8b9717788 (patch)
tree5c2384593278378c9e4917ac0334e9f5d4e87371 /README.md
parent0a35acbbe7e663c643c5b227e455816278e08b89 (diff)
downloadtracifyjs-a7b3b0d3a55e2c48b63102dd111f27f8b9717788.tar.gz
tracifyjs-a7b3b0d3a55e2c48b63102dd111f27f8b9717788.zip
docs: add doc for option.outFileName
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/README.md b/README.md
index 6e9e5f2f..eb3305b6 100644
--- a/README.md
+++ b/README.md
@@ -651,15 +651,22 @@ 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",
+ outFileName: "out.js",
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]). You can set
-option `sourceMapInline` to be `true` and source map will be appended to
-code.
+`result.map`. The value passed for `outSourceMap` is only used to set
+`//# sourceMappingURL=out.js.map` in `result.code`. The value of
+`outFileName` is only used to set `file` attribute in source map file.
+
+The `file` attribute in the source map (see [the spec][sm-spec]) will
+use `outFileName` firstly, if it's falsy, then will be deduced from
+`outSourceMap` (by removing `'.map'`).
+
+You can set option `sourceMapInline` to be `true` and source map will
+be appended to code.
You can also specify sourceRoot property to be included in source map:
```javascript