Skip to content

Commit

Permalink
Fix CLI source-maps examples (#2291)
Browse files Browse the repository at this point in the history
fixes #2284
  • Loading branch information
Dazix authored and alexlamsl committed Aug 29, 2017
1 parent e5cf797 commit eb7adaa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -150,19 +150,19 @@ debugging your compressed JavaScript. To get a source map, pass

Additional options:

- `--source-map filename=<NAME>` to specify the name of the source map.
- `--source-map "filename='<NAME>'"` to specify the name of the source map.

- `--source-map root=<URL>` to pass the URL where the original files can be found.
- `--source-map "root='<URL>'"` to pass the URL where the original files can be found.
Otherwise UglifyJS assumes HTTP `X-SourceMap` is being used and will omit the
`//# sourceMappingURL=` directive.

- `--source-map url=<URL>` to specify the URL where the source map can be found.
- `--source-map "url='<URL>'"` to specify the URL where the source map can be found.

For example:

uglifyjs js/file1.js js/file2.js \
-o foo.min.js -c -m \
--source-map root="http://foo.com/src",url=foo.min.js.map
--source-map "root='http://foo.com/src',url='foo.min.js.map'"

The above will compress and mangle `file1.js` and `file2.js`, will drop the
output in `foo.min.js` and the source map in `foo.min.js.map`. The source
Expand All @@ -181,8 +181,8 @@ CoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript →
compressed JS by mapping every token in the compiled JS to its original
location.

To use this feature pass `--source-map content="/path/to/input/source.map"`
or `--source-map content=inline` if the source map is included inline with
To use this feature pass `--source-map "content='/path/to/input/source.map'"`
or `--source-map "content=inline"` if the source map is included inline with
the sources.

## CLI compress options
Expand Down

0 comments on commit eb7adaa

Please sign in to comment.