-
-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathoptions.ts
42 lines (36 loc) · 1.08 KB
/
options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { CompileError } from './errors'
export type CompileErrorHandler = (error: CompileError) => void
export type CacheKeyHandler = (source: string) => string
export interface TokenizeOptions {
location?: boolean // default true
onError?: CompileErrorHandler
}
export interface ParserOptions {
location?: boolean // default true
onCacheKey?: (source: string) => string
onError?: CompileErrorHandler
}
export interface TransformOptions {
onError?: CompileErrorHandler
}
export interface CodeGenOptions {
location?: boolean // default true
mode?: 'normal' | 'arrow' // default normal
breakLineCode?: '\n' | ';' // default newline
needIndent?: boolean // default true
onError?: CompileErrorHandler
// Generate source map?
// - Default: false
sourceMap?: boolean
// Filename for source map generation.
// - Default: `message.intl`
filename?: string
}
export type CompileOptions = {
optimize?: boolean // default true
mangle?: boolean // default false
jit?: boolean // default false
} & TransformOptions &
CodeGenOptions &
ParserOptions &
TokenizeOptions