title: How to add version number to js and css files
body: <p>I want to insert all my bower components into my index page with appropriate version suffixes. By version suffixes, I mean the version number in every component's specific <code>version</code> attribute in their <code>bower.json</code> file.</p>
  
  <p>As an example,</p>
  
  <p>I have jquery in my application's <code>bower.json</code> dependencies.</p>
  
  <pre><code>{
      "dependencies": {
          "jquery": "^2.2.0",
      }
  }
  </code></pre>
  
  <p>And jquery component has its own <code>.bower.json</code> and that json has a <code>version</code> attribute.</p>
  
  <pre><code>{
    "name": "jquery",
    "main": "dist/jquery.js",
    "license": "MIT",
    "version": "2.2.0"
    // ETC...
  }
  </code></pre>
  
  <p>What I want is to extract this version number from the component's <code>.bower.json</code> file and create a script tag like this</p>
  
  <pre><code>&lt;script src="/bower_components/jquery/dist/jquery.js?version=2.2.0"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I am using a gulp <code>wiredep</code> task to automatically insert my components in index.html. I can add custom suffixes to the src attribute of script tags by overriding options attribute of wiredep, using fileTypes attribute.</p>
  
  <pre><code>fileTypes: {
      html: {
          replace: {
              js: '&lt;script src="{{filePath}}?v=0.1"&gt;&lt;/script&gt;'
          }
      }
  }
  </code></pre>
  
  <p>But I couldn't figure out how to get the version number of each specific component and how to override them seperately when wiredep inserts them on the page.</p>
  
  <p>Is my approach correct? Then, how can I proceed?
  Or there is a better way to accomplish this...</p>
  
  <p><strong>P.S. --</strong> <em>This requirement is related to cache busting. But not at all. I'm using gulp-rev for cache busting my custom application js and css files. But bower componenets should not be cache busted in every build. I want to reference them with their version number and only use cache busting when I update them and cache bust using a new version suffix.</em></p>