Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use terser for Javascript minification #361

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source "https://rubygems.org"

# Specify your gem's dependencies in govuk_tech_docs.gemspec
gemspec

gem "terser"
2 changes: 2 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source "https://rubygems.org"

gem "govuk_tech_docs", path: ".."

gem "terser"
2 changes: 1 addition & 1 deletion example/source/javascripts/govuk_frontend.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//= require govuk_frontend_all
//= require govuk_frontend_all
4 changes: 3 additions & 1 deletion lib/assets/javascripts/govuk_frontend_all.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//= require govuk/govuk-frontend.min.js
initAll()

/* global initAll */
initAll()
1 change: 1 addition & 0 deletions lib/govuk_tech_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def self.configure(context, options = {})

context.configure :build do
activate :autoprefixer
activate :minify_javascript, compressor: Terser.new
# activate :minify_javascript, ignore: ["/raw_assets/*"]
end

Expand Down
Loading