AsyncCompiler
Hierarchy
- AsyncCompiler
Index
Constructors
Methods
Constructors
Private
constructor
- new
Async Compiler(): AsyncCompiler -
Throws an error if constructed directly, instead of via initAsyncCompiler.
Returns AsyncCompiler
Methods
compile Async
- compile
Async(path: string, options?: Options<"async">): Promise<CompileResult> -
The compileAsync method exposed through an Async Compiler instance while it is active. If this is called after dispose on the Async Compiler instance, an error will be thrown.
During the Async Compiler instance's lifespan, given the same input, this will return an identical result to the compileAsync method exposed at the module root.
Parameters
-
path: string
-
Optional
options: Options<"async">
Returns Promise<CompileResult>
-
compile String Async
- compile
String Async(source: string, options?: StringOptions<"async">): Promise<CompileResult> -
The compileStringAsync method exposed through an Async Compiler instance while it is active. If this is called after dispose on the Async Compiler instance, an error will be thrown.
During the Async Compiler instance's lifespan, given the same input, this will return an identical result to the compileStringAsync method exposed at the module root.
Parameters
-
source: string
-
Optional
options: StringOptions<"async">
Returns Promise<CompileResult>
-
dispose
- dispose(): Promise<void>
-
Ends the lifespan of this Async Compiler instance. After this is invoked, all subsequent calls to the Compiler instance's
compileAsync
orcompileStringAsync
methods will result in an error.Any compilations that are submitted before
dispose
will not be cancelled, and will be allowed to settle.After all compilations have been settled and Sass completes any internal task cleanup,
dispose
will resolve its promise.Returns Promise<void>
The result of creating an asynchronous compiler. Returned by initAsyncCompiler.