@use
@forward
@import
@mixin
@include
@function
@extend
@error
@warn
@debug
@at-root
@if
@else
@each
@for
@while
true
false
null
sass:color
sass:list
sass:map
sass:math
sass:meta
sass:selector
sass:string
/
-moz-document
Synchronously compiles the Sass file at path to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an Exception.
path
This only allows synchronous Importers and CustomFunctions.
When using the sass-embedded npm package, compileAsync is almost always faster than compile, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread.
sass-embedded
const sass = require('sass');const result = sass.compile("style.scss");console.log(result.css); Copy
const sass = require('sass');const result = sass.compile("style.scss");console.log(result.css);
Optional
Synchronously compiles the Sass file at
path
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, compileAsync is almost always faster than compile, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread.Example