Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
fix: add guard for options.browser with no pkg.browser field
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Jan 10, 2018
1 parent 1bea2ad commit 6920233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function nodeResolve ( options = {} ) {

if (options.browser && typeof pkg[ 'browser' ] === 'string') {
pkg[ 'main' ] = pkg[ 'browser' ];
} else if (options.browser && pkg[ 'browser' ][ pkg[ 'main' ] ]) {
} else if (options.browser && typeof pkg[ 'browser' ] === 'object' && pkg[ 'browser' ][ pkg[ 'main' ] ]) {
pkg[ 'main' ] = pkg[ 'browser' ][ pkg[ 'main' ] ];
} else if ( useModule && pkg[ 'module' ] ) {
pkg[ 'main' ] = pkg[ 'module' ];
Expand Down

0 comments on commit 6920233

Please sign in to comment.