title: npm pusher and fetch not working with webpack
body: <p>I am using spring-boot as my back end and reactjs for front end and here is the code(not sharing complete code)</p>
  
  <p>Here is my Controller Class</p>
  
  <pre><code>@RestController
  @SessionAttributes(GeneralConstants.ID_SESSION_SHOPPING_CART)
  public class CartController {
  
      private List&lt;Product&gt; products = new ArrayList&lt;Product&gt;();
  
      private Pusher pusher;
  
  
      @PostConstruct
      public void configure() {
          pusher = new Pusher(
                  PusherConstants.PUSHER_APP_ID, 
                  PusherConstants.PUSHER_APP_KEY, 
                  PusherConstants.PUSHER_APP_SECRET
          );
          pusher.setCluster("ap2");
          Product product = new Product();
          product.setId(1L);
          product.setName("Office Chair");
          product.setPrice(new BigDecimal("55.99"));
          products.add(product);
  
  
      }
  
      /**
       * Method that returns the products available for shopping
       * 
       * @return List of product objects
       */
      @RequestMapping(value = "/products", 
              method = RequestMethod.GET,  
              produces = "application/json")
      public List&lt;Product&gt; getProducts() {
          return products;
      }
  </code></pre>
  
  <p>Here is my entry class for react code</p>
  
  <pre><code>var App  = React.createClass ({
    getInitialState: function() {
      return { items: [], products: [] };
    },
    componentWillMount: function() {
        alert("snake2ee")
      this.pusher = new Pusher(arg1, {
        encrypted: true,
        cluster: 'ap2',
      });
      this.channel = this.pusher.subscribe(arg2);
      this.total = 0;
    },
    componentDidMount: function() {
      fetch('/products').then(function(response) {
          return response.json();
      }).then(this.getProductsSuccess);
    },
    componentWillUnmount: function() {
  
      // Unbind from channel events
      this.channel.unbind();
  
      // Unsubscribe from the Pusher channel
      this.pusher.unsubscribe(this.channel);
  
      // Unregister by assign them to an empty function
      this.getProductsSuccess = function() {};
  
    },
    getProductsSuccess: function(response) {
        alert("in success")
  
      this.setState({
          products: response
      });
    },
    render: function() {
      return (
        &lt;div className="container"&gt;
          &lt;Header products={this.state.products} /&gt;
        &lt;/div&gt;
      );
    }
  });
  ReactDOM.render(&lt;App /&gt;, document.getElementById("app"));
  </code></pre>
  
  <p>My code is working fine if i use cdn for react,pusher and fetch.My Problem is i want to use react-toolbox and there is no cdn available for the same so i decided to move to webpack and ignore the use of cdn.But i faced some problems and did not come up with any solution after wasting a lot of time</p>
  
  <pre><code>npm pusher and fetch are not working in webpack
  </code></pre>
  
  <p>Please guide.Thanks:)</p>