-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes the resolution when a package has an invalid "main" but a valid… (
#6682) * Fixes the resolution when a package has an invalid "main" but a valid "index.js" * Update CHANGELOG.md * Fixes the resolution when a package has an invalid "main" but a valid "index.js"
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/pkg-tests/pkg-tests-fixtures/packages/invalid-main-1.0.0/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/pkg-tests/pkg-tests-fixtures/packages/invalid-main-1.0.0/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "invalid-main", | ||
"version": "1.0.0", | ||
"main": "DoesntExists" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters