add or remove "<script src='myscript.js' />" from <head>

I am using Vaadin 8. I need to add or remove "<script src='fortheme.js' />" from <head> on demand. How do I implement this requirement?

Thanks,

James