diff --git a/lib/propshaft/compiler/css_asset_urls.rb b/lib/propshaft/compiler/css_asset_urls.rb index de8a950..5e9a737 100644 --- a/lib/propshaft/compiler/css_asset_urls.rb +++ b/lib/propshaft/compiler/css_asset_urls.rb @@ -13,7 +13,7 @@ def referenced_by(asset, references: Set.new) asset.content.scan(ASSET_URL_PATTERN).each do |referenced_asset_url, _| referenced_asset = load_path.find(resolve_path(asset.logical_path.dirname, referenced_asset_url)) - unless references.include?(referenced_asset) + if referenced_asset && references.exclude?(referenced_asset) references << referenced_asset references.merge referenced_by(referenced_asset, references: references) end diff --git a/test/fixtures/assets/first_path/dependent/b.css b/test/fixtures/assets/first_path/dependent/b.css index 5a89d0f..084de15 100644 --- a/test/fixtures/assets/first_path/dependent/b.css +++ b/test/fixtures/assets/first_path/dependent/b.css @@ -1 +1,2 @@ -@import url('c.css') \ No newline at end of file +@import url('c.css') +@import url('missing.css')