We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3085c5 commit 6d08545Copy full SHA for 6d08545
1 file changed
src/package-reader.js
@@ -24,9 +24,8 @@ export default class PackageReader {
24
this.version = metadata.version || 'N/A';
25
this.browserReplacement = _browserReplacement(metadata.browser);
26
})
27
- .then(() => this._nodejsLoadAsDirectory(''))
28
// when main file is missing, falls back to default index.js
29
- .catch(() => 'index.js')
+ .then(() => this._nodejsLoadAsDirectory('').catch(() => 'index.js'))
30
.then(mainPath => {
31
const replacement = this.browserReplacement['./' + stripJsExtension(mainPath)];
32
if (replacement) {
0 commit comments