extract build_jslibs task into a separate file