Skip to content

Commit

Permalink
[ci skip] replace Uglifier example with Terser
Browse files Browse the repository at this point in the history
Ref: #42589
  • Loading branch information
skipkayhil committed Jun 27, 2021
1 parent 0d8f657 commit 955041b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions guides/source/asset_pipeline.md
Expand Up @@ -1068,20 +1068,20 @@ Possible options for JavaScript compression are `:terser`, `:closure`, `:uglifie
`:yui`. These require the use of the `terser`, `closure-compiler`, `uglifier` or
`yui-compressor` gems, respectively.

Take the `uglifier` gem, for example.
This gem wraps [UglifyJS](https://github.com/mishoo/UglifyJS) (written for
Take the `terser` gem, for example.
This gem wraps [Terser](https://github.com/terser/terser) (written for
NodeJS) in Ruby. It compresses your code by removing white space and comments,
shortening local variable names, and performing other micro-optimizations such
as changing `if` and `else` statements to ternary operators where possible.

The following line invokes `uglifier` for JavaScript compression.
The following line invokes `terser` for JavaScript compression.

```ruby
config.assets.js_compressor = :uglifier
config.assets.js_compressor = :terser
```

NOTE: You will need an [ExecJS](https://github.com/rails/execjs#readme)
supported runtime in order to use `uglifier`. If you are using macOS or
supported runtime in order to use `terser`. If you are using macOS or
Windows you have a JavaScript runtime installed in your operating system.

### GZipping your assets
Expand Down
2 changes: 1 addition & 1 deletion guides/source/configuring.md
Expand Up @@ -172,7 +172,7 @@ pipeline is enabled. It is set to `true` by default.

* `config.assets.css_compressor` defines the CSS compressor to use. It is set by default by `sass-rails`. The unique alternative value at the moment is `:yui`, which uses the `yui-compressor` gem.

* `config.assets.js_compressor` defines the JavaScript compressor to use. Possible values are `:closure`, `:uglifier` and `:yui` which require the use of the `closure-compiler`, `uglifier` or `yui-compressor` gems respectively.
* `config.assets.js_compressor` defines the JavaScript compressor to use. Possible values are `:terser`, `:closure`, `:uglifier` and `:yui` which require the use of the `terser`, `closure-compiler`, `uglifier` or `yui-compressor` gems respectively.

* `config.assets.gzip` a flag that enables the creation of gzipped version of compiled assets, along with non-gzipped assets. Set to `true` by default.

Expand Down

0 comments on commit 955041b

Please sign in to comment.