compileAsync function
- @Deprecated("Use compileToResultAsync() instead.")
- String path, {
- bool color = false,
- Logger? logger,
- Iterable<
AsyncImporter> ? importers, - PackageConfig? packageConfig,
- Iterable<
String> ? loadPaths, - Iterable<
AsyncCallable> ? functions, - OutputStyle? style,
- bool quietDeps = false,
- bool verbose = false,
- @Deprecated("Use CompileResult.sourceMap from compileToResultAsync() instead.") void sourceMap(
- SingleMapping map
Like compile, except it runs asynchronously.
Running asynchronously allows this to take AsyncImporters rather than synchronous Importers. However, running asynchronously is also somewhat slower, so compile should be preferred if possible.
Implementation
@Deprecated("Use compileToResultAsync() instead.")
Future<String> compileAsync(String path,
{bool color = false,
Logger? logger,
Iterable<AsyncImporter>? importers,
PackageConfig? packageConfig,
Iterable<String>? loadPaths,
Iterable<AsyncCallable>? functions,
OutputStyle? style,
bool quietDeps = false,
bool verbose = false,
@Deprecated(
"Use CompileResult.sourceMap from compileToResultAsync() instead.")
void sourceMap(SingleMapping map)?}) async {
var result = await compileToResultAsync(path,
logger: logger,
importers: importers,
loadPaths: loadPaths,
packageConfig: packageConfig,
functions: functions,
style: style,
quietDeps: quietDeps,
verbose: verbose,
sourceMap: sourceMap != null);
result.sourceMap.andThen(sourceMap);
return result.css;
}