ImportCache constructor

ImportCache({
  1. Iterable<Importer>? importers,
  2. Iterable<String>? loadPaths,
  3. PackageConfig? packageConfig,
  4. Logger? logger,
})

Creates an import cache that resolves imports using importers.

Imports are resolved by trying, in order:

  • Each importer in importers.

  • Each load path in loadPaths. Note that this is a shorthand for adding FilesystemImporters to importers.

  • Each load path specified in the SASS_PATH environment variable, which should be semicolon-separated on Windows and colon-separated elsewhere.

  • package: resolution using packageConfig, which is a PackageConfig from the package_config package. Note that this is a shorthand for adding a PackageImporter to importers.

Implementation

ImportCache(
    {Iterable<Importer>? importers,
    Iterable<String>? loadPaths,
    PackageConfig? packageConfig,
    Logger? logger})
    : _importers = _toImporters(importers, loadPaths, packageConfig),
      _logger = logger ?? Logger.stderr();