Skip to content

Commit

Permalink
Use native load_paths (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Apr 13, 2024
1 parent 6dbd28a commit 47b9ab3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/sassc/embedded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ def syntax
end

def load_paths
@load_paths ||= if @options[:importer].nil?
(@options[:load_paths] || []) + SassC.load_paths
else
[]
end
@load_paths ||= (@options[:load_paths] || []) + SassC.load_paths
end
end

Expand Down Expand Up @@ -309,7 +305,6 @@ def initialize(importer)
@importer = importer
@importer_results = {}
@file_url = nil
@load_paths = (@importer.options[:load_paths] || []) + SassC.load_paths
end

def canonicalize(url, context)
Expand Down Expand Up @@ -364,11 +359,8 @@ def find_file_url(_url, context)
private

def resolve_file_url(path, parent_dir, from_import)
[parent_dir].concat(@load_paths).each do |load_path|
resolved = FileSystemImporter.resolve_path(File.absolute_path(path, load_path), from_import)
return URL.path_to_file_url(resolved) unless resolved.nil?
end
nil
resolved = FileSystemImporter.resolve_path(File.absolute_path(path, parent_dir), from_import)
URL.path_to_file_url(resolved) unless resolved.nil?
end

def syntax(path)
Expand Down

0 comments on commit 47b9ab3

Please sign in to comment.