compileAsync
- compileAsync(path: string, options?: Options<"async">): Promise<CompileResult>
-
Parameters
-
path: string
-
Optionaloptions: Options<"async">
Returns Promise<CompileResult>
-
© 2006–2025 the Sass team, and numerous contributors
Licensed under the MIT License.
https://sass-lang.com/documentation/js-api/functions/compileAsync
Asynchronously compiles the Sass file at
pathto CSS. Returns a promise that resolves with a CompileResult if it succeeds and rejects with an Exception if it fails.This only allows synchronous or asynchronous Importers and CustomFunctions.
When using the
sassnpm package, compile is almost twice as fast as compileAsync, due to the overhead of making the entire evaluation process asynchronous.Example