compile function
- @Deprecated("Use compileToResult() instead.")
- String path, {
- bool color = false,
- Logger? logger,
- Iterable<
Importer> ? importers, - Iterable<
String> ? loadPaths, - PackageConfig? packageConfig,
- Iterable<
Callable> ? functions, - OutputStyle? style,
- bool quietDeps = false,
- bool verbose = false,
- @Deprecated("Use CompileResult.sourceMap from compileToResult() instead.") void sourceMap(
- SingleMapping map
- bool charset = true,
Like compileToResult, but returns CompileResult.css rather than returning CompileResult directly.
If sourceMap
is passed, it's passed a SingleMapping
that indicates which
sections of the source file(s) correspond to which in the resulting CSS.
It's called immediately before this method returns, and only if compilation
succeeds. Note that SingleMapping.targetUrl
will always be null
. Users
using the SingleMapping
API should be sure to add the source_maps
package to their pubspec.
This parameter is meant to be used as an out parameter, so that users who want access to the source map can get it. For example:
SingleMapping sourceMap;
var css = compile(sassPath, sourceMap: (map) => sourceMap = map);
Implementation
@Deprecated("Use compileToResult() instead.")
String compile(String path,
{bool color = false,
Logger? logger,
Iterable<Importer>? importers,
Iterable<String>? loadPaths,
PackageConfig? packageConfig,
Iterable<Callable>? functions,
OutputStyle? style,
bool quietDeps = false,
bool verbose = false,
@Deprecated("Use CompileResult.sourceMap from compileToResult() instead.")
void sourceMap(SingleMapping map)?,
bool charset = true}) {
var result = compileToResult(path,
logger: logger,
importers: importers,
loadPaths: loadPaths,
packageConfig: packageConfig,
functions: functions,
style: style,
quietDeps: quietDeps,
verbose: verbose,
sourceMap: sourceMap != null,
charset: charset);
result.sourceMap.andThen(sourceMap);
return result.css;
}