Skip to content

Commit 4d7a0db

Browse files
committed
Update UMD wrapper to include angular-cookies
1 parent af84c5b commit 4d7a0db

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

gulpfile.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,24 @@ var config = {
2727
umd: {
2828
namespace: 'angularOAuth2',
2929
exports: 'ngModule',
30-
deps: [
31-
'angular',
32-
{ name: 'query-string', globalName: 'queryString', paramName: 'queryString' }
33-
]
30+
template: `
31+
(function(root, factory) {
32+
if (typeof define === 'function' && define.amd) {
33+
define([ "angular", "angular-cookies", "query-string" ], factory);
34+
} else if (typeof exports === 'object') {
35+
module.exports = factory(require("angular"), require("angular-cookies"), require("query-string"));
36+
} else {
37+
root.<%= namespace %> = factory(root.angular, 'ngCookies', root.queryString);
38+
}
39+
}(this, function(angular, ngCookies, queryString) {
40+
<% if (exports) { %>
41+
<%= contents %>
42+
return <%= exports %>;
43+
<% } else { %>
44+
return <%= contents %>;
45+
<% } %>
46+
}));
47+
`
3448
},
3549
banner: ['/**',
3650
' * <%= pkg.name %> - <%= pkg.description %>',

src/angular-oauth2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import OAuthProvider from './providers/oauth-provider';
88
import OAuthTokenProvider from './providers/oauth-token-provider';
99
import oauthConfig from './config/oauth-config';
1010
import oauthInterceptor from './interceptors/oauth-interceptor';
11-
import 'angular-cookies';
11+
import ngCookies from 'angular-cookies';
1212

1313
var ngModule = angular.module('angular-oauth2', [
14-
'ngCookies'
14+
ngCookies
1515
])
1616
.config(oauthConfig)
1717
.factory('oauthInterceptor', oauthInterceptor)

0 commit comments

Comments
 (0)