improve requirejs optimizer, export html segment to template