[build] compile_rules: separate js conversion from main code