How to disable modules using config split? I have created different split for each environement (local, dev, test, prod) using the Configuration Split module. How can manage modules (enable/disable) in each environment?

Should I keep core.extensions.yml in each split and remove the module to be uninstalled from the list?
The core.extension.yml should only be put into the default, shared config. As it only holds those modules, that are enabled across all your different environments.

$config_directories['sync'] = '../config/sync/default/shared';


This default Drupal config sync directory also has the config_split.config_split.local.yml in it, which defines which modules apart from the ones in the core.extension.yml should be enabled additionally when the local split is active.

uuid: abc123456-7890-abcd-906d-abc123456
langcode: en
status: false
dependencies: {  }
id: local
label: Local
folder: ../config/sync/default/local
module:
  browsersync: 0
  devel: 0
  features_ui: 0
  field_ui: 0
  kint: 0
  link_css: 0
  masquerade: 0
  views_ui: 0
  webprofiler: 0
theme: {  }
blacklist: {  }
graylist: {  }
graylist_dependents: true
graylist_skip_equal: true
weight: 0


Then, inside each environment's settings.local.php you have to define which split in addition to the default, shared config should be active and which not. Here's how it may be configured on your local machine:

$config['config_split.config_split.local']['status'] = TRUE;
$config['config_split.config_split.dev']['status']   = FALSE;
$config['config_split.config_split.stage']['status'] = FALSE;
$config['config_split.config_split.prod']['status']  = FALSE;




The core.extension.yml only holds those modules that are shared among all your different environments.