title: Grails Resource Plugin - Require module with JS file when AJAX
body: <p>in my grails app, I'm using the awesome resource plugin which wires all the dependencies. When I'm doing the ajax calls I always use <code>&lt;r:layoutResources disposition="defer"/&gt;</code> in order to render all scripts <code>&lt;r:script&gt;...</code> and other dependencies property.</p>
  
  <p>The problem is if I use <code>&lt;r:require module="myModule"/&gt;</code> and the module specify a JS file which was not loaded before (when the page was not loaded). After the AJAX call the JS file is not loaded, what is more or less expected because all JS file should be loaded when the page is rendered.</p>
  
  <p>My question is how to solve it properly? Should I put my r:require to the gsp which is rendered during the first request? Or are there any plans to make the r:require deal with "external" JS files when AJAX?</p>
  
  <p>Thanks,
  Mateo</p>