Improvements and reorganization of assets
This commit is contained in:
parent
896950a605
commit
09a7060659
1
actioncable/.gitignore
vendored
1
actioncable/.gitignore
vendored
@ -1 +1,2 @@
|
||||
/lib/assets/javascripts/action_cable.js
|
||||
/tmp
|
||||
|
@ -19,10 +19,13 @@ end
|
||||
namespace :assets do
|
||||
desc "Compile dist/action_cable.js"
|
||||
task :compile do
|
||||
puts 'Compiling Action Cable assets...'
|
||||
|
||||
asset_mapping = { "source.js" => "action_cable.js" }
|
||||
|
||||
root_path = Pathname.new(dir)
|
||||
load_path = root_path.join("lib/assets/javascripts/action_cable")
|
||||
load_path = root_path.join("app/assets/javascripts/action_cable")
|
||||
destination_path = root_path.join("lib/assets/javascripts")
|
||||
|
||||
compile_path = root_path.join("tmp/sprockets")
|
||||
compile_path.rmtree if compile_path.exist?
|
||||
@ -36,7 +39,10 @@ namespace :assets do
|
||||
|
||||
asset_mapping.each do |logical_path, dist_path|
|
||||
fingerprint_path = manifest.assets[logical_path]
|
||||
FileUtils.cp(compile_path.join(fingerprint_path), load_path.join("dist/#{dist_path}"))
|
||||
FileUtils.cp(compile_path.join(fingerprint_path), destination_path.join(dist_path))
|
||||
end
|
||||
|
||||
puts '======'
|
||||
puts 'Action Cable assets compiled successfully!'
|
||||
end
|
||||
end
|
||||
|
1
actioncable/app/assets/javascripts/action_cable/index.js
Normal file
1
actioncable/app/assets/javascripts/action_cable/index.js
Normal file
@ -0,0 +1 @@
|
||||
//= require_tree ./source
|
@ -1 +0,0 @@
|
||||
//= require ./dist/action_cable
|
Loading…
Reference in New Issue
Block a user