mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:13:39 +08:00
FIX: Re-apply sourceURL in development mode
The `sourceURL` directive must be on the same line as the thing it's referencing. This patch allows it to work again in development mode because each Javascript file ends up in its own `define(...)` line. It will strip out any trailing whitespace and put the `sourceURL` comment on the same line and everything seems to work.
This commit is contained in:
parent
c5eec19368
commit
57390d0bb9
|
@ -16,9 +16,6 @@ class SourceURL < Tilt::Template
|
|||
end
|
||||
|
||||
def evaluate(scope, locals, &block)
|
||||
code = +"\n//# BEGIN sourceURL=#{scope.logical_path}\n"
|
||||
code << data
|
||||
code << "\n//# END sourceURL=#{scope.logical_path}\n"
|
||||
code
|
||||
"#{data.rstrip} //# sourceURL=#{scope.logical_path}\n\n"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user