I tried a lot of approaches besides the ones mentioned above but nothing seem to work. Also considering I did not want the reactjs components to intrude with the grails javascript I did below workaround - hope this might help someone else stuck with similar situation.
I moved the compiled bundle.js into src/main/resources/ and created this ContentController to serve the file as raw javascript file:
@Controller
class ContentController extends RestfulController{
def bundle(){
def myBundleFileContents = getClass().getResource('/bundle.js').text
response.setHeader("Content-disposition", "filename=bundle.js")
response.contentType = 'text/javascript'
response.outputStream << myBundleFileContents
response.outputStream.flush()
}
//more actions
}
Then I included the bundle file in my gsp page as below:
<script type="text/javascript" src="../content/bundle">
</script>