compileStringAsync
- compile
String (source: string, options?: StringOptions<"async">): Promise<CompileResult>Async -
Parameter
-
source: string
-
Optionaloptions: StringOptions<"async">
Gibt Promise<CompileResult> zurück
-
Free Palestine
Optional options: StringOptions<"async">
Kompiliert einen Stylesheet, dessen Inhalt
sourceist, asynchron zu CSS. Gibt ein Promise zurück, das bei Erfolg mit einem CompileResult aufgelöst und bei Fehler mit einer Exception abgelehnt wird.Dies erlaubt nur synchrone oder asynchrone Importer und CustomFunctions.
⚠️ Vorsicht!
Bei Verwendung des
sassnpm-Pakets ist compileString fast doppelt so schnell wie compileStringAsync, aufgrund des Overheads, der durch die asynchrone Verarbeitung des gesamten Auswertungsprozesses entsteht.Beispiel