I am making my first bable plugin that transforms codes during the development.
This plugin will be used with webpack and should handle multiple files.
I need a way to know when babel or webpack has finished the first compilation and starts the watch mode, so at this point, it transforms code after file changed.
Something like this:
export default function ({types: t}) {
return {
visitor: {
Identifier(path) {
if(COMPILED_SUCCESSFULLY)
{
now transform code if file changed.
}
}
}
};
}
Looking at documentation there is no event, variable, or function that tells if compilation finished, but surely there must be one! any idea?