-
-
Notifications
You must be signed in to change notification settings - Fork 204
Closed
Description
Referring to the Node subpath patterns documentation, notice how a pattern can specify a file extension (in this example .js) on both sides of the pattern mapping:
{
"exports": {
"./features/*.js": "./src/features/*.js"
}
}
According to the Node docs,
Including the "*.js" on both sides of the mapping restricts the exposed package exports to only JS files.
However, this does not work in enhanced-resolved. The wildcard pattern without a file extension works fine, for example:
{
"exports": {
"./features/*": "./src/features/*"
}
}
But adding a wildcard file extension does not work. To test this, simply add the following test case to test/exportFields.js:
// ./test/exportFields.js
const testCases = [
//...
{
name: "This will fail!",
expect: ["./src/features/file.js"],
suite: [
{
"./features/*.js": "./src/features/*.js"
},
"./features/file.js",
[]
]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels