Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
aliasing regression fiX
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 11, 2016
1 parent 58d1e69 commit a44315b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function getAlias(loader, canonicalName) {
return;

// get mapped without defaultJSExtension
var mapped = normalizePath(loader, loader.map[alias], true);
var mapped = getCanonicalName(loader, loader.normalizeSync(loader.map[alias]));

// do matching with defaultJSExtension checking
if (loader.defaultJSExtensions && canonicalName == mapped + '.js') {
Expand Down
20 changes: 20 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var Builder = require('../index');
var builder = new Builder();

builder.config({
paths: {
'npm:': 'node_modules/'
},
map: {
x: 'npm:x'
}
});

var utils = require('../lib/utils.js');

suite('Aliasing', function() {
test('getAlias', function(done) {
assert.equal(utils.getAlias(builder.loader, 'npm:x'), 'x');
done();
});
});

0 comments on commit a44315b

Please sign in to comment.