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
|
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
|
||||||
- name: Run gollum from Docker
|
- name: Run gollum from Docker
|
||||||
run: |
|
run: |
|
||||||
RUNNER_TRACKING_ID="" docker run --rm -p 4567:4567 -v $(pwd):/wiki -e CI=true ${{ env.CI_IMAGE }} &
|
git clone test/examples/lotr.git lotr.git
|
||||||
netstat -lt
|
RUNNER_TRACKING_ID="" docker run --rm -p 4567:4567 -v lotr.git:/wiki -e CI=true ${{ env.CI_IMAGE }} &
|
||||||
sleep 10
|
sleep 10
|
||||||
netstat -lt
|
netstat -lt
|
||||||
- name: Run capybara tests against Dockerized instance
|
- 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."
|
"It's possible that you just need to install `yarn` on your system."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require 'uglifier'
|
||||||
|
module Precious
|
||||||
|
module Assets
|
||||||
|
JS_COMPRESSOR = ::Uglifier.new(harmony: true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
require './lib/gollum/app.rb'
|
require './lib/gollum/app.rb'
|
||||||
|
|
||||||
# Next, configure the Sprockets asset pipeline and precompile production-
|
# Next, configure the Sprockets asset pipeline and precompile production-
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
require 'octicons'
|
require 'octicons'
|
||||||
require 'uglifier'
|
|
||||||
|
|
||||||
module Precious
|
module Precious
|
||||||
module Assets
|
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)
|
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'
|
ASSET_URL = 'gollum/assets'
|
||||||
|
JS_COMPRESSOR = :uglify unless defined?(JS_COMPRESSOR)
|
||||||
|
|
||||||
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
||||||
env = Sprockets::Environment.new
|
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/images')
|
||||||
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
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.css_compressor = :scss
|
||||||
|
|
||||||
env.context_class.class_eval do
|
env.context_class.class_eval do
|
||||||
|
|||||||
Reference in New Issue
Block a user