RyanMullins / angular-hammer

Hammer.js v2 support for AngularJS
http://ryanmullins.github.io/angular-hammer/
MIT License
188 stars 55 forks source link

index.js made Webpack include Angular twice #80

Open madflow opened 6 years ago

madflow commented 6 years ago

This is a quick hint for anyone having the same problem and using Webpack. Due to angular-hammer we had Angular duplicated in chunks.

The code in index.js made Webpack include Angular twice.

var angular = require('angular');
Hammer = require('hammerjs');
require('./angular.hammer');

A fix is described here:

https://github.com/webpack/webpack/issues/2134

Or import it differently I guess:

import hammerAngular from 'angular-hammer/angular-hammer';