FilesystemImporter
public protocol FilesystemImporter: Sendable
Methods required to implement a filesystem-redirecting stylesheet importer.
Use this to map imports to a filesystem location, letting the Sass compiler deal with index directories, file extensions, and actually loading the stylesheet.
Topics
func resolve(ruleURL: String, fromImport: Bool, containingURL: URL?) async -> URL?
func resolve(ruleURL: String, fromImport: Bool, containingURL: URL?) async -> URL?
Resolve an imported URL to a filesystem location.
Declaration
Parameters
ruleURL |
The text following |
fromImport |
Whether this request comes from an |
containingURL |
The canonical URL of the source file that contains the load being resolved.
Can be |
Throws
Only when ruleURL
cannot be resolved: it is definitely
this importer’s responsibility to do so, but it can’t.
Compilation will stop, quoting the description of the error thrown as the reason.
Return Value
A file:
URL for the compiler to access, or nil
if the importer doesn’t recognize the
import request: the compiler will try the next importer.