Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resolve): skip
module
field when the importer is a require
ca…
…ll (#7438)
- Loading branch information
Showing
9 changed files
with
56 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
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
5 changes: 5 additions & 0 deletions
5
packages/playground/resolve/require-pkg-with-module-field/dep.cjs
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 @@ | ||
const BigNumber = require('bignumber.js') | ||
|
||
const x = new BigNumber('1111222233334444555566') | ||
|
||
module.exports = x.toString() |
8 changes: 8 additions & 0 deletions
8
packages/playground/resolve/require-pkg-with-module-field/index.cjs
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,8 @@ | ||
const dep = require('./dep.cjs') | ||
|
||
const msg = | ||
dep === '1.111222233334444555566e+21' | ||
? '[success] require-pkg-with-module-field' | ||
: '[failed] require-pkg-with-module-field' | ||
|
||
exports.msg = msg |
9 changes: 9 additions & 0 deletions
9
packages/playground/resolve/require-pkg-with-module-field/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,9 @@ | ||
{ | ||
"name": "require-pkg-with-module-field", | ||
"private": true, | ||
"version": "1.0.0", | ||
"main": "./index.cjs", | ||
"dependencies": { | ||
"bignumber.js": "9.0.2" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -40,5 +40,8 @@ module.exports = { | |
} | ||
} | ||
} | ||
] | ||
], | ||
optimizeDeps: { | ||
include: ['require-pkg-with-module-field'] | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.