/**
* Gets the compiled(&compressed) CSS
*
* @param file the path to a .scss file. File should end with .css or .min.css (The compiler will look for the
* .scss file, then compiles and decides to minify or not).
* @param importer a additional list of importers
* @return Optional with the compiled css as string. Empty optional if the fileName is not valid.
* @throws CompilationException if {@link Compiler#compile(FileContext)} throws
*/
public synchronized Optional<String> getCSSFile(String file, List<Importer> importer)
throws CompilationException, IOException {
if (!isDeveloperMode() && fileCompiledContentMap.containsKey(file)) {
return Optional.of(fileCompiledContentMap.get(file));
} else {
return Optional.ofNullable(compile(file, importer));
}
}
/**
*
* @param scopeClass
* The scope class used with SassResourceReference.
* @param delegate
* The importer that actually imports Sass sources.
*/
public TrackingImporter(String scopeClass, Importer delegate)
{
this.scopeClass = scopeClass;
this.delegate = delegate;
this.importedSources = new ArrayList<>();
}