Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ function acquireWebNodePaths() {
for (const key of Object.keys(webPackages)) {
const packageJSON = path.join(root, 'node_modules', key, 'package.json');
const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8'));
let entryPoint = packageData.browser ?? packageData.main;
// Only cases where the browser is a string are handled
let entryPoint = typeof packageData.browser === 'string' ? packageData.browser : packageData.main;
// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
if (!entryPoint) {
// TODO @lramos15 remove this when jschardet adds an entrypoint so we can warn on all packages w/out entrypoint
Expand Down
3 changes: 2 additions & 1 deletion build/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ export function acquireWebNodePaths() {
for (const key of Object.keys(webPackages)) {
const packageJSON = path.join(root, 'node_modules', key, 'package.json');
const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8'));
let entryPoint: string = packageData.browser ?? packageData.main;
// Only cases where the browser is a string are handled
let entryPoint: string = typeof packageData.browser === 'string' ? packageData.browser : packageData.main;

// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
if (!entryPoint) {
Expand Down