-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b055f5
commit a26bbca
Showing
4 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -801,6 +801,7 @@ DEPENDENCIES | |
simplecov-rcov | ||
slimmer | ||
sprockets-rails | ||
terser | ||
timecop | ||
uglifier | ||
unparser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This adds terser as a recognised compressor | ||
# to Sprockets. Without this patch, Sprockets | ||
# will not be able to run terser. | ||
# | ||
# Code originates from: | ||
# https://stackoverflow.com/a/70086366 | ||
|
||
require "terser" | ||
|
||
module Sprockets | ||
class Environment < Base | ||
def js_compressor=(compressor) | ||
register_compressor "application/javascript", :terser, Terser::Compressor | ||
super | ||
end | ||
end | ||
end |