Skip to content

Commit

Permalink
Merge pull request #10 from hefangshi/master
Browse files Browse the repository at this point in the history
bugfix: 'modules/whatever' will be seen as module by mistake
  • Loading branch information
2betop committed Jan 11, 2015
2 parents d18abbc + ba92cc5 commit 7c30606
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,15 +918,15 @@ function _parseJs(content, file, conf) {
args.push('require');
}

if (args[0] === 'require' && deps[0].substring(1, 8) !== 'require') {
if (args[0] === 'require' && deps[0] !== '\'require\'' && deps[0] !== '\"require\"') {
deps.unshift('\'require\'');
}

if (args[1] === 'exports' && deps[1].substring(1, 8) !== 'exports') {
if (args[1] === 'exports' && deps[1] !== '\'exports\'' && deps[1] !== '\"exports\"') {
deps.splice(1, 0, '\'exports\'');
}

if (args[2] === 'module' && deps[2].substring(1, 7) !== 'module') {
if (args[2] === 'module' && deps[2] !== '\'module\'' && deps[2] !== '\"module\"') {
deps.splice(2, 0, '\'module\'');
}
}
Expand Down Expand Up @@ -1155,4 +1155,4 @@ function travel(info, visitor, child) {
travel(node, visitor, true);
});
}
}
}

0 comments on commit 7c30606

Please sign in to comment.