Skip to content

Commit

Permalink
Replace uglifier with terser
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Jul 30, 2024
1 parent 17271a1 commit d3fc542
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ gem 'sentry-raven'
gem 'sitemap_generator'
gem 'slim'
gem 'slim-rails'
gem 'terser'
gem 'textacular'
gem 'uglifier', '>= 1.3.0'

group :production, :staging do
gem 'rack-timeout'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ GEM
stringio (3.1.1)
strscan (3.1.0)
temple (0.10.3)
terser (1.2.3)
execjs (>= 0.3.0, < 3)
textacular (5.6.0)
activerecord (>= 5.0, < 7.2)
thor (1.3.1)
Expand All @@ -473,8 +475,6 @@ GEM
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.5.0)
web-console (4.2.1)
actionview (>= 6.0.0)
Expand Down Expand Up @@ -556,9 +556,9 @@ DEPENDENCIES
slim
slim-rails
slim_lint
terser
textacular
timecop
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webmock

Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
release: POSTGRES_STATEMENT_TIMEOUT=90s bin/rails heroku:release
release: POSTGRES_STATEMENT_TIMEOUT=90s bin/rails db:prepare
web: bin/rails server
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"website": "",
"repository": "https://github.com/codeforamerica/open311status",
"scripts": {
"postdeploy": "POSTGRES_STATEMENT_TIMEOUT=90s bin/rails heroku:postdeploy"
"postdeploy": "POSTGRES_STATEMENT_TIMEOUT=90s bin/rails db:prepare
},
"env": {
"HEROKU_APP_NAME": {
Expand Down
10 changes: 10 additions & 0 deletions bin/productionlike
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env ruby
ENV["SECRET_KEY_BASE"] = "1"
ENV["RAILS_SERVE_STATIC_FILES"] = "1"
ENV["RAILS_ENV"] = "production"
ENV["RAILS_FORCE_SSL"] = "0"

APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'

6 changes: 3 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
# config.assets.css_compressor = :sass
config.assets.js_compressor = :terser
config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
Expand All @@ -47,7 +47,7 @@
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
config.force_ssl = ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_FORCE_SSL', true))

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
Expand Down
18 changes: 0 additions & 18 deletions lib/tasks/heroku.rake

This file was deleted.

0 comments on commit d3fc542

Please sign in to comment.