      defines = [ "USING_V8_SHARED" ]
    }
    include_dirs = [ "include" ]
-@@ -2328,7 +2344,7 @@ v8_component("v8_libbase") {
- 
-   defines = []
- 
--  if (is_component_build) {
-+  if (is_component_build || is_electron_build) {
-     defines = [ "BUILDING_V8_BASE_SHARED" ]
-   }
- 
-@@ -2418,7 +2434,7 @@ v8_component("v8_libplatform") {
- 
-   configs = [ ":internal_config_base" ]
- 
--  if (is_component_build) {
-+  if (is_component_build || is_electron_build) {
-     defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
-   }
- 
-@@ -2482,6 +2498,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
+@@ -2482,6 +2482,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
  
      configs = [ ":internal_config" ]
  

 
 declare_args() {
   # Includes files needed for correctness fuzzing.
@@ -143,7 +144,13 @@ template("v8_executable") {
 }
 
 template("v8_component") {
-  component(target_name) {
+  if (is_electron_build && !is_component_build &&
+      (target_name == "v8_libbase" || target_name == "v8_libplatform")) {
+    v8_component = "source_set"
+  } else {
+    v8_component = component_electron
+  }
+  target(v8_component, target_name) {
     forward_variables_from(invoker, "*", [ "configs" ])
     configs += invoker.configs
     configs -= v8_remove_configs
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
index e6742c0..ef3876d 100644
--- a/src/inspector/BUILD.gn
+++ b/src/inspector/BUILD.gn
@@ -106,7 +106,7 @@ config("inspector_config") {

   deps = [
     ":v8_libbase",
     "//build/config/sanitizers:deps",
@@ -2588,7 +2592,7 @@ group("v8_fuzzers") {
   ]
 }
 
