Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve leading license comments from multiple files; //, /* and /*! #379

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,14 @@ <h3 id="sec-1-4"><span class="section-number-3">1.4</span> Usage </h3>



<pre class="src src-sh">uglifyjs [ options... ] [ filename ]
<pre class="src src-sh">uglifyjs [ options... ] [ filenames... ]
</pre>


<p>
<code>filename</code> should be the last argument and should name the file from which
to read the JavaScript code. If you don't specify it, it will read code
from STDIN.
<code>filenames</code> should come after all options and should name the files from
which to read the JavaScript code. If you don't specify it, it will read
code from STDIN.
</p>
<p>
Supported options:
Expand All @@ -398,7 +398,8 @@ <h3 id="sec-1-4"><span class="section-number-3">1.4</span> Usage </h3>
options control the beautifier:

<ul>
<li><code>-i N</code> or <code>--indent N</code> &mdash; indentation level (number of spaces)
<li><code>-i N[,M]</code> or <code>--indent N[,M]</code> &mdash; indentation level (number of spaces)
and an optional second value for the starting level

</li>
<li><code>-q</code> or <code>--quote-keys</code> &mdash; quote keys in literal objects (by default,
Expand Down Expand Up @@ -456,6 +457,11 @@ <h3 id="sec-1-4"><span class="section-number-3">1.4</span> Usage </h3>
<li><code>--overwrite</code> &mdash; if the code is read from a file (not from STDIN) and you
pass <code>--overwrite</code> then the output will be written in the same file.

</li>
<li><code>-s</code> or <code>--strict</code> &mdash; adds a global <code>&#8203;"use strict";= directive, allowing
it to be factored out of the code. Ensure your code is strict mode compatible
before using this option.

</li>
<li><code>--ast</code> &mdash; pass this if you want to get the Abstract Syntax Tree instead
of JavaScript as output. Useful for debugging or learning more about the
Expand All @@ -473,8 +479,9 @@ <h3 id="sec-1-4"><span class="section-number-3">1.4</span> Usage </h3>
argument may be specified multiple times to define multiple
symbols - if no value is specified the symbol will be replaced with
the value <code>true</code>, or you can specify a numeric value (such as
<code>1024</code>), a quoted string value (such as ="object"= or
='https://github.com'<code>), or the name of another symbol or keyword (such as =null</code> or <code>document</code>).
<code>1024</code>), a quoted string value (such as <code>&#8203;"object"&#8203;</code> or
<code>&#8203;'https://github.com'&#8203;</code>), a regular expression (such as <code>/[a-z0-9]/g</code>),
or the name of another symbol or keyword (such as <code>null</code> or <code>document</code>).
This allows you, for example, to assign meaningful names to key
constant values but discard the symbolic names in the uglified
version for brevity/efficiency, or when used wth care, allows
Expand Down
21 changes: 13 additions & 8 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,20 @@ There is a command-line tool that exposes the functionality of this library
for your shell-scripting needs:

#+BEGIN_SRC sh
uglifyjs [ options... ] [ filename ]
uglifyjs [ options... ] [ filenames... ]
#+END_SRC

=filename= should be the last argument and should name the file from which
to read the JavaScript code. If you don't specify it, it will read code
from STDIN.
=filenames= should come after all options and should name the files from
which to read the JavaScript code. If you don't specify it, it will read
code from STDIN.

Supported options:

- =-b= or =--beautify= --- output indented code; when passed, additional
options control the beautifier:

- =-i N= or =--indent N= --- indentation level (number of spaces)
- =-i N[,M]= or =--indent N[,M]= --- indentation level (number of spaces)
and an optional second value for the starting level

- =-q= or =--quote-keys= --- quote keys in literal objects (by default,
only keys that cannot be identifier names will be quotes).
Expand Down Expand Up @@ -230,6 +231,10 @@ Supported options:
- =--overwrite= --- if the code is read from a file (not from STDIN) and you
pass =--overwrite= then the output will be written in the same file.

- =-s= or =--strict= --- adds a global =​"use strict";= directive, allowing
it to be factored out of the code. Ensure your code is strict mode compatible
before using this option.

- =--ast= --- pass this if you want to get the Abstract Syntax Tree instead
of JavaScript as output. Useful for debugging or learning more about the
internals.
Expand All @@ -244,9 +249,9 @@ Supported options:
argument may be specified multiple times to define multiple
symbols - if no value is specified the symbol will be replaced with
the value =true=, or you can specify a numeric value (such as
=1024=), a quoted string value (such as ="object"= or
='https://github.com'=), or the name of another symbol or keyword
(such as =null= or =document=).
=1024=), a quoted string value (such as ="object"= or
='https://github.com'=), a regular expression (such as =/[a-z0-9]/g=),
or the name of another symbol or keyword (such as =null= or =document=).
This allows you, for example, to assign meaningful names to key
constant values but discard the symbolic names in the uglified
version for brevity/efficiency, or when used wth care, allows
Expand Down
Loading