-
-
Save christhekeele/0ecfe1e14d037be49eaf to your computer and use it in GitHub Desktop.
Middleman Rails Assets config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config.rb | |
after_configuration do | |
if defined?(RailsAssets) | |
RailsAssets.load_paths.each do |path| | |
sprockets.append_path path unless sprockets.paths.include? path | |
Dir[File.join(path, '*')].select do |contents| | |
File.file? contents | |
end.map do |file| | |
Pathname.new File.basename file | |
end.each do |asset| | |
sprockets.import_asset asset unless sprockets.imported_assets.map(&:logical_path).include? asset | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment