Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Commit 6c7597f

Browse files
committed
Allow angular modules to use aliases
1 parent c8dfe4e commit 6c7597f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ AngularPlugin.prototype = {
8080

8181
// This injects the angular module wherever it's used.
8282
addAngularVariable: function(parser) {
83-
return ModuleParserHelpers.addParsedVariable(parser, 'angular', "require('angular')");
83+
return ModuleParserHelpers.addParsedVariable(parser, 'angular', "require('exports?window.angular!angular')");
8484
},
8585

8686
// Each call to `angular.module()` is analysed here
@@ -136,7 +136,7 @@ AngularPlugin.prototype = {
136136
});
137137

138138
return resolver.forEachBail(requests, function(req, cb){
139-
return resolver.doResolve(["file", "directory"], req, cb, true);
139+
return resolver.doResolve("module", req, cb, true);
140140
}, function(err, resolved){
141141
if( err || !resolved ){
142142
return callback(err);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
}
2121
],
2222
"peerDependencies": {
23-
"webpack": "~1.1.0"
23+
"webpack": "^1.1.0",
24+
"exports-loader": "^0.6.2"
2425
},
2526
"devDependencies": {
2627
"grunt-contrib-jshint": "0.10.0",

0 commit comments

Comments
 (0)