From 3d6e85795780712a390682e97a626d6508cd91a2 Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Thu, 20 Mar 2014 12:13:52 -0600 Subject: [PATCH] updated readme to reflect updates to functionality --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 27d06cd6..d0bae950 100644 --- a/README.md +++ b/README.md @@ -444,6 +444,15 @@ 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 also pass in an array of file contents to minify, as well as an array of the relative file paths to include in the source map: +```javascript +var result = UglifyJS.minify(["function () {/* ... */}"], { + outSourceMap: "out.js.map", + sourcePaths: ["some-file.js"] +}); +``` +Note that the sourcePaths need to be relative to where you end up saving the outSourceMap. The array of file contents also need to match up with the sourcePaths array. This functionality has only found itself useful in certain build processes. + You can also specify sourceRoot property to be included in source map: ```javascript var result = UglifyJS.minify([ "file1.js", "file2.js", "file3.js" ], {