terser 1.1.17 → 1.1.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da43fa919f823977e14273029f62095aa3ba543bd8ea0704999d699fb1e50d7b
4
- data.tar.gz: 211b0f09002e37478f5866f8394a5aba2f9c984235d0ccf5d2d8b2079ecf99cd
3
+ metadata.gz: 7185d1e264312605c30f6a7db59bdabd6c89381127b6ac8828ad644fe197cd10
4
+ data.tar.gz: cabd1e6d541a5ea97c3cc06fa9bb0310fb2a8379cd4049b1e02bafeab5b321b7
5
5
  SHA512:
6
- metadata.gz: 7c0f070a8b4eab6183c92b5dd2ef60b04e45f9eced0b2a8701bf218ce2b7101f46ab93676299d7546fdc09903606303f93f5e3b913987e141f7193d013c4faae
7
- data.tar.gz: e187bf407f3f98be8e473014b03e68799ecf589b1c0e6a1877327ca6731eaf701efee1bbb7cdd6684eb31afbc48d5dbb9cf098ff7a09f2cb0d5e9bca088eba86
6
+ metadata.gz: d341f559c2453e97b8815ecbdfd976607e7ff6aaa94f2cedbdbbb9b9b253cc92481370233d178600becdb1c1b452fa16890de3b88c62d2a5f6f30fa3064c3ff5
7
+ data.tar.gz: 75eb897e01aae9f0613b59abc4c09c8c17b75b134ca8cbf829cd36629e792643263683526e1513069027bb0efb6bdf9e0cf20ac928540240ca374bbcb840ee68
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  ## Unreleased
2
+ ## 1.1.19 (19 October 2023)
3
+ - update TerserJS to [5.22.0]
4
+ - enable passing terser options with Rails directly
5
+
6
+ ## 1.1.18 (5 September 2023)
7
+ - update TerserJS to [5.19.4]
8
+
2
9
  ## 1.1.17 (14 July 2023)
3
10
  - update TerserJS to [5.19.0]
4
11
 
data/README.md CHANGED
@@ -18,6 +18,15 @@ Rails.application.configure do
18
18
  config.assets.js_compressor = :terser
19
19
  end
20
20
  ```
21
+
22
+ Passing terser options
23
+
24
+ ```ruby
25
+ Rails.application.configure do
26
+ config.assets.terser = { compress: { drop_console: true } }
27
+ end
28
+ ```
29
+
21
30
  in `config/environments/production.rb`.
22
31
 
23
32
  ## Installation
@@ -80,8 +89,8 @@ Available options and their defaults are
80
89
  :indent_start => 0, # Starting indent level
81
90
  :width => 80, # Specify line width when beautifier is used (only with beautifier)
82
91
  :preamble => nil, # Preamble for the generated JS file. Can be used to insert any code or comment.
83
- :wrap_iife => false # Wrap IIFEs in parenthesis. Note: this disables the negate_iife compression option.
84
- :shebang => true # Preserve shebang (#!) in preamble (shell scripts)
92
+ :wrap_iife => false, # Wrap IIFEs in parenthesis. Note: this disables the negate_iife compression option.
93
+ :shebang => true, # Preserve shebang (#!) in preamble (shell scripts)
85
94
  :quote_style => 0, # Quote style, possible values :auto (default), :single, :double, :original
86
95
  :keep_quoted_props => false # Keep quotes property names
87
96
  },
@@ -97,7 +106,7 @@ Available options and their defaults are
97
106
  :regex => nil, # A regular expression to filter property names to be mangled
98
107
  :ignore_quoted => false, # Only mangle unquoted property names
99
108
  :debug => false, # Mangle names with the original name still present
100
- } # Mangle property names, disabled by default
109
+ }, # Mangle property names, disabled by default
101
110
  :compress => {
102
111
  :sequences => true, # Allow statements to be joined by commas
103
112
  :properties => true, # Rewrite property access using the dot notation
@@ -10,7 +10,7 @@ class Terser
10
10
 
11
11
  def initialize(options = {})
12
12
  options[:comments] ||= :none
13
- @options = options
13
+ @options = options.merge(Rails.application.config.assets.terser.to_h)
14
14
  @cache_key = -"Terser:#{::Terser::VERSION}:#{VERSION}:#{::Sprockets::DigestUtils.digest(options)}"
15
15
  @terser = ::Terser.new(@options)
16
16
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  class Terser
4
4
  # Current version of Terser.
5
- VERSION = "1.1.17"
5
+ VERSION = "1.1.19"
6
6
  end