Update build template to add support for rewritebase