From 96856bacd75bedcf1a09e89a66ee7083d8e069d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 4 Jul 2018 07:45:06 +0200 Subject: [PATCH] Prioritize browser field over module (#1662) --- src/Resolver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resolver.js b/src/Resolver.js index 734d6e86aeb..d8f71c5d585 100644 --- a/src/Resolver.js +++ b/src/Resolver.js @@ -273,9 +273,9 @@ class Resolver { } // libraries like d3.js specifies node.js specific files in the "main" which breaks the build - // we use the "module" or "browser" field to get the full dependency tree if available. + // we use the "browser" or "module" field to get the full dependency tree if available. // If this is a linked module with a `source` field, use that as the entry point. - let main = [pkg.source, pkg.module, browser, pkg.main].find( + let main = [pkg.source, browser, pkg.module, pkg.main].find( entry => typeof entry === 'string' );