{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/angular-auth0/issues/9","repository_url":"https://api.github.com/repos/auth0/angular-auth0","labels_url":"https://api.github.com/repos/auth0/angular-auth0/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/auth0/angular-auth0/issues/9/comments","events_url":"https://api.github.com/repos/auth0/angular-auth0/issues/9/events","html_url":"https://github.com/auth0/angular-auth0/issues/9","id":192324250,"number":9,"title":"Problems with webpack 1 and ES6","user":{"login":"jfmercer","id":590520,"avatar_url":"https://avatars.githubusercontent.com/u/590520?v=3","gravatar_id":"","url":"https://api.github.com/users/jfmercer","html_url":"https://github.com/jfmercer","followers_url":"https://api.github.com/users/jfmercer/followers","following_url":"https://api.github.com/users/jfmercer/following{/other_user}","gists_url":"https://api.github.com/users/jfmercer/gists{/gist_id}","starred_url":"https://api.github.com/users/jfmercer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfmercer/subscriptions","organizations_url":"https://api.github.com/users/jfmercer/orgs","repos_url":"https://api.github.com/users/jfmercer/repos","events_url":"https://api.github.com/users/jfmercer/events{/privacy}","received_events_url":"https://api.github.com/users/jfmercer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-29T16:07:26Z","updated_at":"2016-12-20T07:10:40Z","closed_at":null,"body":"With webpack 1 and ES6, and I cannot replace `auth0-angular` with `angular-auth0`. \r\n\r\nPreviously, my auth0 module looked like this:\r\n\r\n```js\r\nimport * as angular from 'angular';\r\n\r\nimport 'auth0-js';\r\nimport auth0 from 'auth0-angular';\r\n\r\nexport default angular.module('authZero', [\r\n  auth0\r\n]).name;\r\n```\r\n\r\nIn webpack, I used to the `ProvidePlugin` to make `Auth0` globally available on the `window` object:\r\n\r\n```js\r\nnew webpack.ProvidePlugin({\r\n  'window.Auth0': 'auth0-js'\r\n})\r\n```\r\n\r\nWith `angular-auth0`, depending on my configuration, I get a variety of errors. I compared `angular-auth0` with `auth0-angular` to see why one worked with webpack module bundling & the other did not. I suspect that the difference is that `auth0-angular` [uses `node`'s standard `module.exports` syntax](https://github.com/auth0/auth0-angular/blob/master/index.js#L2):\r\n\r\n```js\r\nrequire('./build/auth0-angular.js');\r\nmodule.exports = 'auth0';\r\n```\r\n\r\nCould `angular-auth0` be changed to add compatibility standard node module bundling tools, such as webpack? I could put in a PR for this if you think it worthwhile.\r\n"},"comment":{"url":"https://api.github.com/repos/auth0/angular-auth0/issues/comments/268171522","html_url":"https://github.com/auth0/angular-auth0/issues/9#issuecomment-268171522","issue_url":"https://api.github.com/repos/auth0/angular-auth0/issues/9","id":268171522,"user":{"login":"samber","id":2951285,"avatar_url":"https://avatars.githubusercontent.com/u/2951285?v=3","gravatar_id":"","url":"https://api.github.com/users/samber","html_url":"https://github.com/samber","followers_url":"https://api.github.com/users/samber/followers","following_url":"https://api.github.com/users/samber/following{/other_user}","gists_url":"https://api.github.com/users/samber/gists{/gist_id}","starred_url":"https://api.github.com/users/samber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samber/subscriptions","organizations_url":"https://api.github.com/users/samber/orgs","repos_url":"https://api.github.com/users/samber/repos","events_url":"https://api.github.com/users/samber/events{/privacy}","received_events_url":"https://api.github.com/users/samber/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T07:10:40Z","updated_at":"2016-12-20T07:10:40Z","body":"Is there any news about this issue ?\r\n\r\nHow can I use angular-auth0 with webpack ?"}}
{"actor":{"display_login":"samber"}}