title: Loading masonry-layout in webpack
body: <p>I have an <a href="https://angular.io/" rel="nofollow">angular 2</a> project based on <a href="https://github.com/AngularClass/angular2-webpack-starter/" rel="nofollow">angular2-webpack-starter</a>. It is using webpack, and it works very well for a lot of imports, even jQuery plugins..</p>
  
  <p>I am trying to get <a href="https://github.com/jelgblad/angular2-masonry" rel="nofollow">angular2-masonry</a> to work now, but it depends on the <code>masonry-layout</code> package (<a href="https://www.npmjs.com/package/masonry-layout" rel="nofollow">npm module</a> / <a href="https://github.com/desandro/masonry" rel="nofollow">github source</a>), which does not play nicely...
  The importing (<code>import * as masonry from 'masonry-layout'</code>), wont work and is giving the error <code>Cannot find module 'masonry-layout'.</code>.</p>
  
  <p>How can I get webpack to see this as a module?</p>
  
  <p>I have tried (only relevant webpack config);</p>
  
  <p><strong>Setting alias to <code>masonry.pkgd.js</code></strong></p>
  
  <pre><code>module.exports = {
    resolve: {
      alias: {
        'masonry-layout': 'masonry-layout/dist/masonry.pkgd.js'
      }
    }
  }
  </code></pre>
  
  <p>Gives the same error</p>
  
  <p><strong>Setting alias to <code>masonry.js</code></strong></p>
  
  <pre><code>module.exports = {
    resolve: {
      alias: {
        'masonry-layout': 'masonry-layout/masonry.js'
      }
    }
  }
  </code></pre>
  
  <p>Same error</p>
  
  <p><strong>Adding a custom loader, and installing <code>imports-loader</code> as suggested <a href="https://github.com/desandro/masonry/issues/679#issuecomment-78625842" rel="nofollow">here</a></strong></p>
  
  <pre><code>module.exports = {
    module: {
      loaders: [
        {
          test: /masonry-layout/,
          loader: 'imports?define=&gt;false&amp;this=&gt;window'
        }
      ]
    }
  }
  </code></pre>
  
  <p>Same error!</p>
  
  <p>Only by combining the first (<code>'masonry-layout': 'masonry-layout/dist/masonry.pkgd.js'</code>) and the last, I am getting another error;</p>
  
  <pre><code>ERROR in ./~/masonry-layout/dist/masonry.pkgd.js
  Module not found: Error: Cannot resolve 'file' or 'directory' ./item in /.../node_modules/masonry-layout/dist
   @ ./~/masonry-layout/dist/masonry.pkgd.js 1351:6-23
  </code></pre>
  
  <p>But only in addition, I am still getting the <code>Cannot find module 'masonry-layout'.</code> error.</p>
  
  <p>I am still new to webpack, so I might miss something obvious...</p>