title: How can I use a local file during Require.js optimisation, but a CDN-hosted version at runtime?
body: <p>My page includes several components that exist as separate AMD modules. Each of these components is turned into a single file by the Require.js optimiser. Because several of these components share dependencies (e.g. jQuery and d3), the optimiser <code>paths</code> config uses CDN URLs for those dependencies, rather than bundling them into the optimised file.</p>
  
  <p>Here's where it gets tricky. I've written a <a href="https://github.com/RactiveJS/requirejs-ractive">module loader plugin</a> for <a href="http://ractivejs.org">Ractive.js</a> called rvc.js, which allows me to include Ractive components that are defined in HTML files. (Yes, I'm asking for help on how to use my own library.)</p>
  
  <p>This works fine - code like this gets optimised as you'd expect:</p>
  
  <pre><code>define( function ( require ) {
    var ChartView = require( 'rvc!views/Chart' );
    var view = new ChartView({ el: 'chart' });
  });
  </code></pre>
  
  <p>Because Ractive is used by several of the components, it should be served from a CDN like jQuery and d3. But it's used by rvc.js during the optimisation process, which means that the <code>Ractive</code> entry for the optimiser's <code>paths</code> config can't point to a CDN - it has to point to a local file.</p>
  
  <p>Is there a way to tell Require.js 'use the local file during optimisation, but load from CDN at runtime'?</p>