title: requirejs optimizer window is not defined error
body: <p>I am making an app which is using node, backbone and requirejs together. I need to optimize the js but I am running into the error <code>Reference Error: Window is not defined</code> when I try to run the optimized file using node through command prompt.</p>
  
  <p>I searched for solutions and read about <a href="http://requirejs.org/docs/plugins.html" rel="nofollow">plugin-builder</a> and also found an <a href="https://github.com/jrburke/requirejs/blob/master/tests/plugins/index.js" rel="nofollow">example</a>, but I am not sure exactly how to make that thing work.</p>
  
  <p>I have my main file main.js in which I have defined config for <code>requirejs(paths,shim etc.)</code> and a build.js for optimizer in which I have defined the parameters for optimizing</p>
  
  <pre><code>({
      baseUrl: ".",
      mainConfigFile: 'main.js',
      name: "main",
      out: "main-built.js"
  })
  </code></pre>
  
  <p>Any help on how to proceed further?</p>