Skip to content

Pre/post process callbacks/hooks #29

@nolimits4web

Description

@nolimits4web

This is also can be useful, if compiler will accept pre and post process hooks, it will allow to do extra modifications with input/output:

  • preContent - hook that will receive input file string. It can return modified string that will be proceeded by compiler to ast and so on
  • preAst - hook that will receive ast when it was just parsed to ast by component, but didn't go through any modifications/transformers yet
  • postAst - hook that will receive ast after it passed all transformers and just before its compilation back to string in compiler
  • postContent - hook that will receive compiled from ast script string, right before it will be saved to file. It can return modified string that will be saved to file

I think we may such hooks/callbacks on both root config level and separately for each compiler (vue, react)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions