Skip to content

Commit

Permalink
Merge pull request #305 from webpack/bugfix/alias-field-dot
Browse files Browse the repository at this point in the history
fix bug when aliasing `.`
  • Loading branch information
sokra committed Sep 20, 2021
2 parents 60d79f3 + 63fff62 commit 3f6d259
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/getInnerRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function getInnerRequest(resolver, request) {
let innerRequest;
if (request.request) {
innerRequest = request.request;
if (/^\.\.?\//.test(innerRequest) && request.relativePath) {
if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) {
innerRequest = resolver.join(request.relativePath, innerRequest);
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/browser-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"./lib/ignore.js": false,
"./lib/replaced.js": "./lib/browser",
"module-a": "./browser/module-a.js",
"module-b": "module-c"
"module-b": "module-c",
".": false
},
"innerBrowser1": {
"field": {
Expand Down

0 comments on commit 3f6d259

Please sign in to comment.