File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,8 @@ function acquireWebNodePaths() {
302
302
for ( const key of Object . keys ( webPackages ) ) {
303
303
const packageJSON = path . join ( root , 'node_modules' , key , 'package.json' ) ;
304
304
const packageData = JSON . parse ( fs . readFileSync ( packageJSON , 'utf8' ) ) ;
305
- let entryPoint = packageData . browser ?? packageData . main ;
305
+ // Only cases where the browser is a string are handled
306
+ let entryPoint = typeof packageData . browser === 'string' ? packageData . browser : packageData . main ;
306
307
// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
307
308
if ( ! entryPoint ) {
308
309
// TODO @lramos 15 remove this when jschardet adds an entrypoint so we can warn on all packages w/out entrypoint
Original file line number Diff line number Diff line change @@ -371,7 +371,8 @@ export function acquireWebNodePaths() {
371
371
for ( const key of Object . keys ( webPackages ) ) {
372
372
const packageJSON = path . join ( root , 'node_modules' , key , 'package.json' ) ;
373
373
const packageData = JSON . parse ( fs . readFileSync ( packageJSON , 'utf8' ) ) ;
374
- let entryPoint : string = packageData . browser ?? packageData . main ;
374
+ // Only cases where the browser is a string are handled
375
+ let entryPoint : string = typeof packageData . browser === 'string' ? packageData . browser : packageData . main ;
375
376
376
377
// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
377
378
if ( ! entryPoint ) {
You can’t perform that action at this time.
0 commit comments