Synchronously compiles a stylesheet whose contents is source to CSS. If it
succeeds it returns a CompileResult, and if it fails it throws an
Exception.
When using the sass-embedded npm package,
compileStringAsync is almost always faster than
compileString, due to the overhead of emulating synchronous
messaging with worker threads and concurrent compilations being blocked on
mainthread.
Synchronously compiles a stylesheet whose contents is
source
to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an Exception.This only allows synchronous Importers and CustomFunctions.
⚠️ Atenção!
When using the
sass-embedded
npm package, compileStringAsync is almost always faster than compileString, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread.Example