I hereby claim:
- I am iantheparker on github.
- I am iantheparker (https://keybase.io/iantheparker) on keybase.
- I have a public key ASBa9MDrV6XQEwPJ_pgwaQTdNj81c6xHsLEv2rfI8zGGwwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
desc "resolve_asset paths installed via Yarn" | |
task :resolve_assets => :environment do | |
components_directory = 'node_modules' | |
root_directory = components_directory | |
# Resolve relative paths in CSS | |
Dir["#{components_directory}/**/*.css"].each do |filename| | |
contents = File.read(filename) if FileTest.file?(filename) | |
# http://www.w3.org/TR/CSS2/syndata.html#uri | |
url_regex = /url\((?!\#)\s*['"]?((?![a-z]+:)([^'"\)]*?)([?#][^'"\)]*)?)['"]?\s*\)/ |