static void hotSwapTranspile ( AbstractCompiler compiler , Node scriptRoot , FeatureSet featureSet , Callback ... callbacks ) { if ( compiler . getOptions ( ) . needsTranspilationFrom ( featureSet ) ) { FeatureSet languageOutFeatures = compiler . getOptions ( ) . getOutputFeatureSet ( ) ; if ( doesScriptHaveUnsupportedFeatures ( scriptRoot , languageOutFeatures ) ) { for ( Callback callback : callbacks ) { scriptRoot . putBooleanProp ( Node . TRANSPILED , true ) ; NodeTraversal . traverse ( compiler , scriptRoot , callback ) ; } } } }
Hot - swap ES6 + transpilations if the input language needs transpilation from certain features on any JS file that has features not present in the compiler s output language mode .