@bazel/terser
Advanced tools
Comparing version 2.0.3 to 2.1.0
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
const pkg = require('./package.json'); | ||
const pkgVersion = pkg.version || '0.0.0'; | ||
const pkgVersion = pkg.version ? pkg.version.split('-')[0] : '0.0.0'; | ||
@@ -22,2 +22,2 @@ // BUILD_BAZEL_RULES_NODEJS_VERSION is only set when within the bazel context | ||
See https://github.com/bazelbuild/rules_nodejs/wiki/Avoiding-version-skew`); | ||
} | ||
} |
@@ -8,3 +8,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type" : "git", |
138
README.md
@@ -28,5 +28,2 @@ # Terser rules for Bazel | ||
[name]: https://bazel.build/docs/build-ref.html#name | ||
[label]: https://bazel.build/docs/build-ref.html#labels | ||
[labels]: https://bazel.build/docs/build-ref.html#labels | ||
@@ -54,26 +51,50 @@ | ||
<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> | ||
### Usage | ||
**ATTRIBUTES** | ||
``` | ||
terser_minified(name, args, config_file, debug, sourcemap, src, terser_bin) | ||
``` | ||
<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. | ||
#### `name` | ||
(*[name], mandatory*): A unique name for this target. | ||
#### `args` | ||
(*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 `[]` | ||
#### `config_file` | ||
(*[label]*): A JSON file containing Terser minify() options. | ||
This is the file you would pass to the --config-file argument in terser's CLI. | ||
@@ -84,3 +105,3 @@ https://github.com/terser-js/terser#minify-options documents the content of the file. | ||
> Run bazel with `--subcommands` to see the path to the copied file. | ||
Run bazel with `--subcommands` to see the path to the copied file. | ||
@@ -91,3 +112,3 @@ If you use the magic strings `"bazel_debug"` or `"bazel_no_debug"`, these will be | ||
For example, | ||
For example | ||
@@ -101,25 +122,44 @@ ``` | ||
``` | ||
Will disable the `arrows` compression setting when debugging. | ||
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` | ||
#### `debug` | ||
(*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` | ||
#### `sourcemap` | ||
(*Boolean*): Whether to produce a .js.map output | ||
Defaults to `True` | ||
#### `src` | ||
(*[label], 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. | ||
@@ -129,7 +169,23 @@ | ||
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> | ||
#### `terser_bin` | ||
(*[label]*): An executable target that runs Terser | ||
Defaults to `//@bazel/terser/bin:terser` | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33314
194
186