Skip to content

Commit 1a7177e

Browse files
committed
fix(join) parse: add support of join.js urls with no "/" at the beginning'
1 parent 4293162 commit 1a7177e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/join.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
function parse(prefix, dir, url) {
6969
var names,
7070
joinPath = prefix + prefix + '.js',
71+
joinOpt = joinPath.replace('/', '/?'),
72+
joinRegExp = RegExp(joinOpt),
7173
isStr = typeof url === 'string';
7274

7375
if (!isStr)
@@ -76,7 +78,7 @@
7678
names = url.replace(prefix + ':', '')
7779
.split(':')
7880
.map(function(name) {
79-
if (name === joinPath) {
81+
if (joinRegExp.test(name)) {
8082
name = FILE;
8183
} else {
8284
name = path.join(dir, name);

0 commit comments

Comments
 (0)