@bazel/terser
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -8,3 +8,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type" : "git", |
140
README.md
@@ -32,2 +32,8 @@ # Terser rules for Bazel | ||
**USAGE** | ||
<pre> | ||
terser_minified(<a href="#terser_minified-name">name</a>, <a href="#terser_minified-args">args</a>, <a href="#terser_minified-config_file">config_file</a>, <a href="#terser_minified-debug">debug</a>, <a href="#terser_minified-sourcemap">sourcemap</a>, <a href="#terser_minified-src">src</a>, <a href="#terser_minified-terser_bin">terser_bin</a>) | ||
</pre> | ||
Run the terser minifier. | ||
@@ -51,50 +57,24 @@ | ||
<pre> | ||
terser_minified(<a href="#terser_minified-name">name</a>, <a href="#terser_minified-args">args</a>, <a href="#terser_minified-config_file">config_file</a>, <a href="#terser_minified-debug">debug</a>, <a href="#terser_minified-sourcemap">sourcemap</a>, <a href="#terser_minified-src">src</a>, <a href="#terser_minified-terser_bin">terser_bin</a>) | ||
</pre> | ||
**ATTRIBUTES** | ||
<table class="table table-params"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Description</th> | ||
<th>Type</th> | ||
<th>Mandatory</th> | ||
<th>Default</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr id="terser_minified-name"> | ||
<td>name</td> | ||
<td> | ||
A unique name for this target. | ||
</td> | ||
<td><a href="https://bazel.build/docs/build-ref.html#name">Name</a></td> | ||
<td>required</td> | ||
<td> | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-args"> | ||
<td>args</td> | ||
<td> | ||
Additional command line arguments to pass to terser. | ||
<h4 id="terser_minified-name">name</h4> | ||
(*<a href="https://bazel.build/docs/build-ref.html#name">Name</a>, mandatory*): A unique name for this target. | ||
<h4 id="terser_minified-args">args</h4> | ||
(*List of strings*): Additional command line arguments to pass to terser. | ||
Terser only parses minify() args from the config file so additional arguments such as `--comments` may | ||
be passed to the rule using this attribute. See https://github.com/terser/terser#command-line-usage for the | ||
full list of terser CLI options. | ||
</td> | ||
<td>List of strings</td> | ||
<td>optional</td> | ||
<td> | ||
[] | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-config_file"> | ||
<td>config_file</td> | ||
<td> | ||
A JSON file containing Terser minify() options. | ||
Defaults to `[]` | ||
<h4 id="terser_minified-config_file">config_file</h4> | ||
(*<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>*): A JSON file containing Terser minify() options. | ||
This is the file you would pass to the --config-file argument in terser's CLI. | ||
@@ -124,40 +104,25 @@ https://github.com/terser-js/terser#minify-options documents the content of the file. | ||
If `config_file` isn't supplied, Bazel will use a default config file. | ||
</td> | ||
<td><a href="https://bazel.build/docs/build-ref.html#labels">Label</a></td> | ||
<td>optional</td> | ||
<td> | ||
//@bazel/terser:terser_config.default.json | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-debug"> | ||
<td>debug</td> | ||
<td> | ||
Configure terser to produce more readable output. | ||
Defaults to `//@bazel/terser:terser_config.default.json` | ||
<h4 id="terser_minified-debug">debug</h4> | ||
(*Boolean*): Configure terser to produce more readable output. | ||
Instead of setting this attribute, consider using debugging compilation mode instead | ||
bazel build --compilation_mode=dbg //my/terser:target | ||
so that it only affects the current build. | ||
</td> | ||
<td>Boolean</td> | ||
<td>optional</td> | ||
<td> | ||
False | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-sourcemap"> | ||
<td>sourcemap</td> | ||
<td> | ||
Whether to produce a .js.map output | ||
</td> | ||
<td>Boolean</td> | ||
<td>optional</td> | ||
<td> | ||
True | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-src"> | ||
<td>src</td> | ||
<td> | ||
File(s) to minify. | ||
Defaults to `False` | ||
<h4 id="terser_minified-sourcemap">sourcemap</h4> | ||
(*Boolean*): Whether to produce a .js.map output | ||
Defaults to `True` | ||
<h4 id="terser_minified-src">src</h4> | ||
(*<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>, mandatory*): File(s) to minify. | ||
Can be a .js file, a rule producing .js files as its default output, or a rule producing a directory of .js files. | ||
@@ -167,23 +132,10 @@ | ||
If you want to do this, you can pass a filegroup here. | ||
</td> | ||
<td><a href="https://bazel.build/docs/build-ref.html#labels">Label</a></td> | ||
<td>required</td> | ||
<td> | ||
</td> | ||
</tr> | ||
<tr id="terser_minified-terser_bin"> | ||
<td>terser_bin</td> | ||
<td> | ||
An executable target that runs Terser | ||
</td> | ||
<td><a href="https://bazel.build/docs/build-ref.html#labels">Label</a></td> | ||
<td>optional</td> | ||
<td> | ||
//@bazel/terser/bin:terser | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<h4 id="terser_minified-terser_bin">terser_bin</h4> | ||
(*<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>*): An executable target that runs Terser | ||
Defaults to `//@bazel/terser/bin:terser` | ||
31873
138