解放巴勒斯坦(Free Palestine)
@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
--
meta.feature-exists
建立一個非同步的 AsyncCompiler。每個編譯器實例在其生命週期內都公開了 compileAsync 和 compileStringAsync 方法。給定相同的輸入,這些方法將返回與模組根目錄公開的對應方法相同的結果。要使用同步編譯,請使用 initCompiler;
當多次呼叫編譯函式時,使用 sass-embedded npm 套件的編譯器實例比使用頂層編譯方法或 sass npm 套件快得多。
const sass = require('sass');async function setup() { const compiler = await sass.initAsyncCompiler(); const result1 = await compiler.compileStringAsync('a {b: c}').css; const result2 = await compiler.compileStringAsync('a {b: c}').css; await compiler.dispose(); // throws error const result3 = await sass.compileStringAsync('a {b: c}').css;} Copy
const sass = require('sass');async function setup() { const compiler = await sass.initAsyncCompiler(); const result1 = await compiler.compileStringAsync('a {b: c}').css; const result2 = await compiler.compileStringAsync('a {b: c}').css; await compiler.dispose(); // throws error const result3 = await sass.compileStringAsync('a {b: c}').css;}
建立一個非同步的 AsyncCompiler。每個編譯器實例在其生命週期內都公開了 compileAsync 和 compileStringAsync 方法。給定相同的輸入,這些方法將返回與模組根目錄公開的對應方法相同的結果。要使用同步編譯,請使用 initCompiler;
當多次呼叫編譯函式時,使用 sass-embedded npm 套件的編譯器實例比使用頂層編譯方法或 sass npm 套件快得多。
範例