mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
FEATURE: upgrade sprockets to latest stable
This unlocks Rails upgrades, so we can now upgrade to latest Rails
This commit is contained in:
parent
c381086314
commit
6e5296a510
|
@ -358,10 +358,10 @@ GEM
|
|||
spork-rails (4.0.0)
|
||||
rails (>= 3.0.0, < 5)
|
||||
spork (>= 1.0rc0)
|
||||
sprockets (3.6.3)
|
||||
sprockets (3.7.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.1.1)
|
||||
sprockets-rails (3.2.0)
|
||||
actionpack (>= 4.0)
|
||||
activesupport (>= 4.0)
|
||||
sprockets (>= 3.0.0)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'sprockets'
|
||||
|
||||
Sprockets.register_engine '.es6', Tilt::ES6ModuleTranspilerTemplate
|
||||
Sprockets.register_mime_type 'application/ecmascript6', extensions: ['.es6', '.js.es6'], charset: :unicode
|
||||
Sprockets.register_transformer 'application/ecmascript6', 'application/javascript', Tilt::ES6ModuleTranspilerTemplate
|
||||
|
|
|
@ -10,6 +10,15 @@ module Tilt
|
|||
@mutex = Mutex.new
|
||||
@ctx_init = Mutex.new
|
||||
|
||||
def self.call(input)
|
||||
filename = input[:filename]
|
||||
source = input[:data]
|
||||
context = input[:environment].context_class.new(input)
|
||||
|
||||
result = new(filename){source}.render(context)
|
||||
context.metadata.merge(data: result)
|
||||
end
|
||||
|
||||
def prepare
|
||||
# intentionally left empty
|
||||
# Tilt requires this method to be defined
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
class SourceURL < Tilt::Template
|
||||
self.default_mime_type = 'application/javascript'
|
||||
|
||||
def self.call(input)
|
||||
filename = input[:filename]
|
||||
source = input[:data]
|
||||
context = input[:environment].context_class.new(input)
|
||||
|
||||
result = new(filename){source}.render(context)
|
||||
context.metadata.merge(data: result)
|
||||
end
|
||||
|
||||
def prepare
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user