diff --git a/Gemfile b/Gemfile index e3c78d49..8cbb8467 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source "https://rubygems.org" # Specify your gem's dependencies in govuk_tech_docs.gemspec gemspec + +gem "terser" \ No newline at end of file diff --git a/example/Gemfile b/example/Gemfile index 0d4908e1..d4b4869f 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -1,3 +1,5 @@ source "https://rubygems.org" gem "govuk_tech_docs", path: ".." + +gem "terser" diff --git a/lib/govuk_tech_docs.rb b/lib/govuk_tech_docs.rb index cf5733ac..8f066cae 100644 --- a/lib/govuk_tech_docs.rb +++ b/lib/govuk_tech_docs.rb @@ -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