From 7484a0994fafec4147719ae9818ba0044475a183 Mon Sep 17 00:00:00 2001 From: Sergey Ilyevsky Date: Thu, 8 Jun 2023 13:04:39 +0300 Subject: [PATCH] fix for non-working browser mapping to false together with an onLoad plugin --- internal/bundler/bundler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/bundler/bundler.go b/internal/bundler/bundler.go index 9d53da34ee1..1e4aeffb895 100644 --- a/internal/bundler/bundler.go +++ b/internal/bundler/bundler.go @@ -908,6 +908,11 @@ func runOnLoadPlugins( } tracker := logger.MakeLineColumnTracker(importSource) + // Force disabled modules to be empty + if source.KeyPath.IsDisabled() { + return loaderPluginResult{loader: config.LoaderEmpty}, true + } + // Apply loader plugins in order until one succeeds for _, plugin := range plugins { for _, onLoad := range plugin.OnLoad { @@ -965,11 +970,6 @@ func runOnLoadPlugins( } } - // Force disabled modules to be empty - if source.KeyPath.IsDisabled() { - return loaderPluginResult{loader: config.LoaderEmpty}, true - } - // Read normal modules from disk if source.KeyPath.Namespace == "file" { if contents, err, originalError := fsCache.ReadFile(fs, source.KeyPath.Text); err == nil {