title: How to bundle images using webpack?
body: <p>I am making an angular2 application with webpack module bundler. Now i have added file-loader for loading image files such as jpg, gif, png,etc. But when i run the build command the image files are not being bundled. Here is my configuration:</p>
  
  <p><strong>webpack.config.js</strong> <em>(image loader config only)</em></p>
  
  <pre><code>{
      test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)(\?v=.+)?$/,
      loader: 'file-loader?name=assets/[name].[hash].[ext]'
  },
  </code></pre>
  
  <p>I have included images from a folder in my html template like this:</p>
  
  <pre><code>&lt;img src="/asset/img/myImg.png"/&gt;
  </code></pre>
  
  <p>in my css too: </p>
  
  <pre><code>#myBackground {
      background: background: #344556 url(/assets/img/background.jpg) center/cover;
  }
  </code></pre>
  
  <p>But when i build the whole application, the images are not placed in the assets folder like i have specified in the webpack config.</p>
  
  <p>Now the strangest thing is the same configuration is used for the fonts and they are being created inside the assets folder. This is my css for including the fonts in style.css:</p>
  
  <pre><code>@font-face {
      font-family: 'robotolight';
      src: url("../fonts/roboto-light-webfont.eot");
      src: url("../fonts/roboto-light-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/roboto-light-webfont.woff2") format("woff2"), url("../fonts/roboto-light-webfont.woff") format("woff"), url("../fonts/roboto-light-webfont.ttf") format("truetype"), url("../fonts/roboto-light-webfont.svg#robotolight") format("svg");
      font-weight: normal;
      font-style: normal;
   }
  </code></pre>
  
  <p>This font's all the files like svgs, ttf, woff, etc can be found in the assets folder after running the build.</p>
  
  <p>Can anyone tell me why the images are not being created in the assets folder but the fonts file are, with the same config/loader.</p>