Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looks like requireJs thinks that you're trying to provide a paths fallback for underscore, since you're specifying its path value as an array. Try just doing it as a string instead.</p> <pre><code>paths: { underscore: 'underscore-amd.min' } </code></pre> <p>Also note that the <a href="http://requirejs.org/docs/optimization.html#empty">correct symbol for empty paths</a> is <code>empty:</code> (with a ':') not <code>empty</code>.</p> <p>Finally, as an unrelated side note you could always look at <a href="http://lodash.com/">lodash</a> which is IMHO a more customizable, cross-browser compliant, faster underscore replacement with an identical API and it's hosted on cdnjs and is AMD-compliant</p> <p><strong>UPDATE</strong></p> <p>Following up on the conversation within the comments, here's my updated version of your project: <a href="https://dl.dropboxusercontent.com/u/21823728/so_rjs.tar.gz">https://dl.dropboxusercontent.com/u/21823728/so_rjs.tar.gz</a></p> <p>As mentioned in the comments, your problem seemed to be that you were <code>define</code>ing modules within the same file that you were requiring those modules in, and that I believe was causing r.js to believe that these modules had no main entry point. The convention is to separate out module definitions from files that require those modules.</p> <p>Notice there's an <code>app</code> folder now under <code>assets/js</code> where each module that used to be <code>define</code>d within your page modules is now stored. Your page modules now <code>require</code> these modules in. When I re-ran <code>r.js</code> (using uglify2 as the optimizer) everything seemed to work as expected. </p> <p>Furthermore, I removed some redundancy from your build.js file (you only have to specify baseUrl in your mainConfigFile if that's the one you're using for your build configuration as well). Finally, you may want to look into using the <a href="http://requirejs.org/docs/api.html#config-shim">shim config</a> if you want to attach jQuery and Bootstrap globally to every page. Otherwise you should just explicitly list them as dependencies when you need them. </p> <p>Finally as one last piece of advice you may want to look at cutting down on the number of <code>require</code> within each file. For most of those pages you could wrap everything in one require call and then just separate out different logic into functions to save some space on the event queue and also some cycles of having to redundantly call the <code>require</code> function. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload