Compiler
Hierarchy
- Compiler
Index
Constructors
Methods
Constructors
Private
constructor
- new
Compiler(): Compiler -
Throws an error if constructed directly, instead of via initCompiler.
Returns Compiler
Methods
compile
- compile(path: string, options?: Options<"sync">): CompileResult
-
The compile method exposed through a Compiler instance while it is active. If this is called after dispose on the Compiler instance, an error will be thrown.
During the Compiler instance's lifespan, given the same input, this will return an identical result to the compile method exposed at the module root.
Parameters
-
path: string
-
Optional
options: Options<"sync">
Returns CompileResult
-
compile String
- compile
String(source: string, options?: StringOptions<"sync">): CompileResult -
The compileString method exposed through a Compiler instance while it is active. If this is called after dispose on the Compiler instance, an error will be thrown.
During the Compiler instance's lifespan, given the same input, this will return an identical result to the compileString method exposed at the module root.
Parameters
-
source: string
-
Optional
options: StringOptions<"sync">
Returns CompileResult
-
dispose
- dispose(): void
-
Ends the lifespan of this Compiler instance. After this is invoked, all calls to the Compiler instance's compile or compileString methods will result in an error.
Returns void
The result of creating a synchronous compiler. Returned by initCompiler.