Skip to content

Commit

Permalink
feat(compiler-core/internal): add onContextCreated option to `gener…
Browse files Browse the repository at this point in the history
…ate` (#1672)
  • Loading branch information
znck authored Jul 21, 2020
1 parent 4951d43 commit 615dccd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/compiler-core/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ function createCodegenContext(

export function generate(
ast: RootNode,
options: CodegenOptions = {}
options: CodegenOptions & {
onContextCreated?: (context: CodegenContext) => void
} = {}
): CodegenResult {
const context = createCodegenContext(ast, options)
if (options.onContextCreated) options.onContextCreated(context)
const {
mode,
push,
Expand Down

0 comments on commit 615dccd

Please sign in to comment.