Skip to content

Commit 0ed6d9a

Browse files
committed
Only add assets to precompile list for Sprockets
1 parent 08706cc commit 0ed6d9a

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

lib/blazer/engine.rb

+18-16
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ class Engine < ::Rails::Engine
33
isolate_namespace Blazer
44

55
initializer "blazer" do |app|
6-
if defined?(Sprockets) && Sprockets::VERSION.to_i >= 4
7-
app.config.assets.precompile += [
8-
"blazer/application.js",
9-
"blazer/application.css",
10-
"blazer/glyphicons-halflings-regular.eot",
11-
"blazer/glyphicons-halflings-regular.svg",
12-
"blazer/glyphicons-halflings-regular.ttf",
13-
"blazer/glyphicons-halflings-regular.woff",
14-
"blazer/glyphicons-halflings-regular.woff2",
15-
"blazer/favicon.png"
16-
]
17-
else
18-
# use a proc instead of a string
19-
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
20-
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ }
21-
app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
6+
if defined?(Sprockets)
7+
if Sprockets::VERSION.to_i >= 4
8+
app.config.assets.precompile += [
9+
"blazer/application.js",
10+
"blazer/application.css",
11+
"blazer/glyphicons-halflings-regular.eot",
12+
"blazer/glyphicons-halflings-regular.svg",
13+
"blazer/glyphicons-halflings-regular.ttf",
14+
"blazer/glyphicons-halflings-regular.woff",
15+
"blazer/glyphicons-halflings-regular.woff2",
16+
"blazer/favicon.png"
17+
]
18+
else
19+
# use a proc instead of a string
20+
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
21+
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ }
22+
app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
23+
end
2224
end
2325

2426
Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone

0 commit comments

Comments
 (0)