terser 1.1.16 → 1.1.20

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: 57437e2e3d2af55587b82c14ff639135a66bd4ac94f9a8977e3489260685ea4a
4
- data.tar.gz: 691d600cdb1b6064f72e1c4499da9ae26e88a494c1e895aa04c1105906a9e8e8
3
+ metadata.gz: 5d777d8166a7f751e18d241f116de9a7036f23879f4771cc4aa08fed42fcc8ac
4
+ data.tar.gz: acdda2846f802cf5d280dae3ba1308ec49dbd9e630141923a5655c61098d2d6c
5
5
  SHA512:
6
- metadata.gz: 5ef67365b2f1919d5e42a02b53ad2fa475b8ab858613cbf2913cc526ed525ddbc2537b9675467c60e7e0b4b13ee5e33f581bcc9525235b84c77f98cd5eeda669
7
- data.tar.gz: 49cb4674b89bfa8cd3e4b8e6b9e5789169932e80781467d6f0797fa8986f7948ec96c30626901a5bc6f21e9a05e66ee695b8e5c8308d4947263aef292a9e2536
6
+ metadata.gz: a22e3a47a38b2407120f975c9123df23a99eb17ef3619aeecb238d316e2adf2dfd5979812ce8a550fd48b2f385014ec4cadb8410ab18515d996df954337ca1ac
7
+ data.tar.gz: 94cd1508d80ef1e4f55f16e074329140968e3ce58bfd52b72d8cc1ab071171204a4997a420da0fef340d1a774581817bc9ef99934a5a213dcf2358a3341a0bbb
data/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
  ## Unreleased
2
+ ## 1.1.20 (27 November 2023)
3
+ - update TerserJS to [5.24.0]
4
+ - fix mangle properties, thanks @khaitu!
5
+
6
+ ## 1.1.19 (19 October 2023)
7
+ - update TerserJS to [5.22.0]
8
+ - enable passing terser options with Rails directly
9
+
10
+ ## 1.1.18 (5 September 2023)
11
+ - update TerserJS to [5.19.4]
12
+
13
+ ## 1.1.17 (14 July 2023)
14
+ - update TerserJS to [5.19.0]
15
+
2
16
  ## 1.1.16 (01 June 2023)
3
17
  - update TerserJS to [5.17.7]
4
18
 
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.16"
5
+ VERSION = "1.1.20"
6
6
  end