Commit 3a80b88f authored by Lukas Eipert's avatar Lukas Eipert

Prepare page specific bundles for EE versions

Currently `app/assets/` is always taken before `ee/app/assets`, because
it is prepended by sprocket-rails. By creating our own initializer we
can insure that `ee/app/assets` takes precedence.
parent 27318298
......@@ -219,13 +219,6 @@ module Gitlab
config.assets.paths << "#{config.root}/node_modules/xterm/src/"
config.assets.precompile << "xterm.css"
# Add EE assets
if Gitlab.ee?
%w[images javascripts stylesheets].each do |path|
config.assets.paths << "#{config.root}/ee/app/assets/#{path}"
end
end
# Import path for EE specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence:
......@@ -327,6 +320,20 @@ module Gitlab
end
end
# Add EE assets. They should take precedence over CE. This means if two files exist, e.g.:
#
# ee/app/assets/stylesheets/example.scss
# app/assets/stylesheets/example.scss
#
# The ee/ version will be preferred.
initializer :prefer_ee_assets, after: :append_assets_path do |app|
if Gitlab.ee?
%w[images javascripts stylesheets].each do |path|
app.config.assets.paths.unshift("#{config.root}/ee/app/assets/#{path}")
end
end
end
config.after_initialize do
# Devise (see initializers/8_devise.rb) already reloads routes if
# eager loading is enabled, so don't do this twice since it's
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment