r.js minified optimized file not running
<p>BEFORE, I was using r.js to optimize and minify my javascript successfully.  I had a main.js file that looked something like this:</p>

<pre><code>require.config({
    baseUrl: "scripts/lib",
    paths: {
        jquery: "http://code.jquery.com/jquery-1.11.2.min",
        underscore: "https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min",
        d3: "d3-for-development",
        katex: "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min", // or 0.2.0
        mathjax: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&amp;amp;delayStartupUntil=configured",
        etc...
    },
    shim: {
        underscore: { exports: "_" },
        chosen: { deps: ["jquery"] },
        mathjax: {
            exports: "MathJax",
            init: function (){
                MathJax.Hub.Config({
                    tex2jax: {
                        inlineMath: [['$','$'], ['\\(','\\)']],
                        processEscapes: true,
                    },
                });
                MathJax.Hub.Startup.onload();
                return MathJax;
            }
        },
    },
});

require( [
    "jquery",
    "underscore",
    "browser-detect",
    "check-types",
    "katex",
    "mathjax",
    etc
], function(
    $,
    _,
    browser,
    check,
    katex,
    mathjax,
    etc
){

/////////////////////////// INITIALIZATION ///////////////////////////
loginInit()
show('#login')

etc...
</code></pre>

<p>and I could successfully run <code>node build/r.js -o mainConfigFile=www/scripts/main.js baseUrl=www/scripts/lib name=../main out=www/scripts/main-optimized.min.js generateSourceMap=true preserveLicenseComments=false optimize=uglify2</code> to minify.  Everything worked.</p>

<p>NOW, I have a config.js file that looks like this:</p>

<pre><code>require.config({
    urlArgs: "bust=" + new Date().getTime(),
    baseUrl: "scripts/lib",
    paths: {
        jquery: ["jquery-min", "http://code.jquery.com/jquery-1.11.2.min"],
        underscore: ["underscore-min", "https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min"],
        d3: "d3-for-development", // if we add patches separately, then we can just use https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min
        katex: ["katex-min", "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"], // or 0.2.0
        mathjax: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&amp;amp;delayStartupUntil=configured",
        main: "../main",
        etc...
    },
    shim: {
        underscore: { exports: "_" },
        chosen: { deps: ["jquery"] },
        mathjax: {
            exports: "MathJax",
            init: function init() {
                MathJax.Hub.Config({
                    tex2jax: {
                        inlineMath: [['$', '$'], ['\\(', '\\)']],
                        processEscapes: true }
                });
                MathJax.Hub.Startup.onload();
                return MathJax;
            }
        }
    }
});

require(["main"], function (main) {
    // pass.  by loading main, we run main.js
});
</code></pre>

<p>Instead of passing the minify/optimize arguments straight into the command line, I've created a <code>rbuild.js</code> file for that:</p>

<pre><code>({
    mainConfigFile: "../www/scripts/config.js",
    baseUrl: "../www/scripts/lib",
    name: "../config",
    out: "../www/scripts/config-optimized.min.js",
    generateSourceMap: true,
    preserveLicenseComments: false, // this is necessary for generateSourceMap to work
    optimize: "uglify2",
    // removeCombined: true,
    // findNestedDependencies: true,
    paths: {
        // https://github.com/jrburke/requirejs/issues/791
        // http://www.anthb.com/2014/07/04/optimising-requirejs-with-cdn-fallback
        jquery: "jquery-min",
        underscore: "underscore-min",
        d3: "d3-for-development",
        katex: "katex-min",
        mathjax: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&amp;amp;delayStartupUntil=configured",
        marked: "marked",
        chosen: "chosen-min",
        jsnetworkx: "jsnetworkx-min",
        main: "../main",
    },
})
</code></pre>

<p>and I run it with <code>node build/r.js -o build/rbuild.js</code> in the command line.  It appears to run successfully and makes the <code>config-optimized.min.js</code> file, as expected.  The output is:</p>

<pre><code>Tracing dependencies for: ../config
Cannot optimize network URL, skipping: http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&amp;amp;delayStartupUntil=configured
Uglify2 file: /Users/Matthew/programming/prove-math/www/scripts/config-optimized.min.js

/Users/Matthew/programming/prove-math/www/scripts/config-optimized.min.js
----------------
/Users/Matthew/programming/prove-math/www/scripts/lib/jquery-min.js
/Users/Matthew/programming/prove-math/www/scripts/lib/underscore-min.js
/Users/Matthew/programming/prove-math/www/scripts/lib/browser-detect.js
/Users/Matthew/programming/prove-math/www/scripts/lib/check-types.js
/Users/Matthew/programming/prove-math/www/scripts/lib/katex-min.js
/Users/Matthew/programming/prove-math/www/scripts/lib/profile.js
/Users/Matthew/programming/prove-math/www/scripts/lib/marked.js
/Users/Matthew/programming/prove-math/www/scripts/lib/d3-for-development.js
/Users/Matthew/programming/prove-math/www/scripts/lib/user.js
/Users/Matthew/programming/prove-math/www/scripts/lib/graph-animation.js
/Users/Matthew/programming/prove-math/www/scripts/lib/graph.js
/Users/Matthew/programming/prove-math/www/scripts/lib/node.js
/Users/Matthew/programming/prove-math/www/scripts/lib/blinds.js
/Users/Matthew/programming/prove-math/www/scripts/lib/chosen-min.js
/Users/Matthew/programming/prove-math/www/scripts/main.js
/Users/Matthew/programming/prove-math/www/scripts/lib/../config.js
</code></pre>

<p>But when I visit <code>index.html</code> via my server, the page is blank.  The JS console gives no errors or log messages, which suggests that no JS is being run.  My server gives no errors, which suggests that everything has been sent to the client successfully, and the client JS is not running.</p>

<p>So I'm pretty convinced the JS is there but not running.  Is there something wrong with my setup that causes <code>config.js</code> to not run the code?  With no error messages, I am having trouble troubleshooting :)</p>