Skip to content

Commit 615dccd

Browse files
authored
feat(compiler-core/internal): add onContextCreated option to generate (#1672)
1 parent 4951d43 commit 615dccd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/compiler-core/src/codegen.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@ function createCodegenContext(
180180

181181
export function generate(
182182
ast: RootNode,
183-
options: CodegenOptions = {}
183+
options: CodegenOptions & {
184+
onContextCreated?: (context: CodegenContext) => void
185+
} = {}
184186
): CodegenResult {
185187
const context = createCodegenContext(ast, options)
188+
if (options.onContextCreated) options.onContextCreated(context)
186189
const {
187190
mode,
188191
push,

0 commit comments

Comments
 (0)