Only require uglifier when precompiling
This commit is contained in:
@@ -47,8 +47,8 @@ jobs:
|
||||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
|
||||
- name: Run gollum from Docker
|
||||
run: |
|
||||
RUNNER_TRACKING_ID="" docker run --rm -p 4567:4567 -v $(pwd):/wiki -e CI=true ${{ env.CI_IMAGE }} &
|
||||
netstat -lt
|
||||
git clone test/examples/lotr.git lotr.git
|
||||
RUNNER_TRACKING_ID="" docker run --rm -p 4567:4567 -v lotr.git:/wiki -e CI=true ${{ env.CI_IMAGE }} &
|
||||
sleep 10
|
||||
netstat -lt
|
||||
- name: Run capybara tests against Dockerized instance
|
||||
|
||||
@@ -248,6 +248,13 @@ task :precompile do
|
||||
"It's possible that you just need to install `yarn` on your system."
|
||||
end
|
||||
|
||||
require 'uglifier'
|
||||
module Precious
|
||||
module Assets
|
||||
JS_COMPRESSOR = ::Uglifier.new(harmony: true)
|
||||
end
|
||||
end
|
||||
|
||||
require './lib/gollum/app.rb'
|
||||
|
||||
# Next, configure the Sprockets asset pipeline and precompile production-
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
require 'octicons'
|
||||
require 'uglifier'
|
||||
|
||||
module Precious
|
||||
module Assets
|
||||
MANIFEST = %w(app.js editor.js mermaid.js app.css criticmarkup.css fileview.css ie7.css print.css *.png *.jpg *.svg *.eot *.ttf)
|
||||
ASSET_URL = 'gollum/assets'
|
||||
JS_COMPRESSOR = :uglify unless defined?(JS_COMPRESSOR)
|
||||
|
||||
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
||||
env = Sprockets::Environment.new
|
||||
@@ -17,7 +17,7 @@ module Precious
|
||||
env.append_path ::File.join(dir, 'public/gollum/images')
|
||||
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
||||
|
||||
env.js_compressor = ::Uglifier.new(harmony: true) unless Precious::App.development?
|
||||
env.js_compressor = Precious::Assets::JS_COMPRESSOR unless Precious::App.development?
|
||||
env.css_compressor = :scss
|
||||
|
||||
env.context_class.class_eval do
|
||||
|
||||
Reference in New Issue
Block a user