8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/livescript/rails/processor.rb', line 8
def self.call(input)
data = input[:data]
options = {
bare: true,
header: false,
map: 'linked-src',
filename: input[:source_path] || input[:filename],
}.merge(::Rails.application.config.assets.livescript || {})
result = input[:cache].fetch([self.cache_key, data]) do
LiveScript.compile(data, options)
end
if result.kind_of? Hash
{
data: result['code'],
map: result['map'],
}
else
result
end
end
|