Minify JS: migrate from Uglifier to Terser gem to support ES6 (#2532)

* Minify JS: migrate from Uglifier to Terser gem to support ES6

* rebase and bundle update

Co-authored-by: Thomas Reynolds <me@tdreyno.com>
This commit is contained in:
Marc Anguera 2022-01-30 20:37:53 +01:00 committed by GitHub
parent d2da5440e5
commit 3c34c18bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 12 deletions

View File

@ -28,9 +28,9 @@ PATH
rgl (~> 0.5)
sassc (~> 2)
servolux
terser (~> 1.1)
tilt (~> 2.0.9)
toml
uglifier (~> 4)
webrick
GEM
@ -146,13 +146,13 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
mini_portile2 (2.7.1)
minitest (5.15.0)
multi_test (0.1.2)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nokogiri (1.13.1)
mini_portile2 (~> 2.7.0)
nokogiri (1.13.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.1-x86_64-linux)
racc (~> 1.4)
oj (3.13.11)
padrino-helpers (0.15.1)
@ -244,6 +244,8 @@ GEM
sys-uname (1.2.2)
ffi (~> 1.1)
temple (0.8.2)
terser (1.1.8)
execjs (>= 0.3.0, < 3)
thor (1.2.1)
tilt (2.0.10)
timers (4.3.3)
@ -251,8 +253,6 @@ GEM
parslet (>= 1.8.0, < 3.0.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.1.0)
webrick (1.7.0)
xpath (3.2.0)
@ -261,7 +261,8 @@ GEM
webrick (~> 1.7.0)
PLATFORMS
ruby
x86_64-darwin-19
x86_64-linux
DEPENDENCIES
addressable (~> 2.8)
@ -291,4 +292,4 @@ DEPENDENCIES
yard (~> 0.9.27)
BUNDLED WITH
2.3.4
2.3.3

View File

@ -440,6 +440,7 @@ Feature: Run the preview server
Server name "garbage.example.com" does not resolve to an ip address. Please fix that and try again.
"""
@wip
Scenario: Start the server with server name "www.example.com" and the network name server is used to resolve the server name
Given I have a local hosts file with:
"""

View File

@ -24,7 +24,7 @@ interfaces = [
]
# Start the RubyDNS server
RubyDNS.run_server(listen: interfaces) do
RubyDNS.run_server(interfaces) do
db.each do |matcher, result|
match(matcher, Resolv::DNS::Resource::IN::A) do |transaction|
transaction.respond!(result)

View File

@ -8,8 +8,8 @@ class Middleman::Extensions::MinifyJavaScript < ::Middleman::Extension
option :inline, false, 'Whether to minify JS inline within HTML files'
option :ignore, [], 'Patterns to avoid minifying'
option :compressor, proc {
require 'uglifier'
::Uglifier.new
require 'terser'
::Terser.new
}, 'Set the JS compressor to use.'
option :content_types, %w[application/javascript], 'Content types of resources that contain JS'
option :inline_content_types, %w[text/html text/php], 'Content types of resources that contain inline JS'

View File

@ -48,7 +48,7 @@ Gem::Specification.new do |s|
s.add_dependency('sassc', ['~> 2'])
# Minify JS
s.add_dependency('uglifier', ['~> 4'])
s.add_dependency('terser', ['~> 1.1'])
s.add_dependency('execjs', ['~> 2'])
# Perf