title: How to Add Global/Public Variables to grunt-contrib-uglify Output
body: <p>Okay, so I am way new to Grunt and Node.js. I am building a site, and decided that the 'main.js' file was getting way too big. So, I split it up, and I am now trying to use Grunt to piece all of these JS files back together.</p>
  
  <p>The issue that I have is that I need to make some global variables available to all of the various functions in all of these JS files. To be more specific, every page on our site is identified via an <code>id</code> in the body tag:</p>
  
  <pre><code>&lt;body id="home"&gt;
  </code></pre>
  
  <p>Many of these JS files contain if statements that ensure certain functions only run if the appropriate page is loaded. For example:</p>
  
  <pre><code>if (page == 'home') {
      var title = "Home Page"
      $('.page-title').text(title);
  }
  </code></pre>
  
  <p>Notice the <code>page</code> variable? That guy is the one that I need to make available to all of these files (after grunt-contrib-uglify merges them together). So, I figured I'd assign a new "unique" variable name, and make it global.</p>
  
  <p>I noticed that <a href="https://github.com/gruntjs/grunt-contrib-uglify" rel="nofollow">grunt-contrib-uglify</a> has a '<a href="https://github.com/gruntjs/grunt-contrib-uglify#wrap" rel="nofollow">wrap</a>' option listed in its documentation. However, no examples are given as to how to use it.</p>
  
  <p>Can anyone tell me:
  - How to use the 'wrap' option in 'grunt-contrib-uglify'
  - If this is the right grunt plugin for what I am trying to do?</p>
  
  <p>One idea I had (as a last resort) is to create a <code>before.js</code> and <code>after.js</code> and put the beginning and end (respectively) of what I wish to wrap around the other files in each. But, I think the 'wrap' option is what I need, yes?</p>
  
  <p><strong><em>UPDATE:</em></strong> Here is a link to my "merged" JS file:
  <a href="http://nwca.com/js/main.js" rel="nofollow">main.js</a></p>
  
  <p>And a link to my Gruntfile:
  <a href="https://github.com/DerekFoulk/nwca-nitrosell/blob/master/Gruntfile.js" rel="nofollow">Gruntfile.js</a></p>