<?php
/**
* Implements hook_module_implements_alter().
*/
function YOURMODULENAME_module_implements_alter(&$implementations, $hook) {
switch ($hook) {
// I want that my hook_form_alter will execute last
// Move our hook_entity_type_alter() implementation to the end of the list.
$hook = "form_alter";
$my_module = 'MYMODULENAME';
case $hook:
$group = $implementations[$my_module];
unset($implementations[$my_module]);
$implementations[$my_module] = $group;
break;
// I want that my hook_form_alter will execute first
// Move our hook_entity_bundle_info_alter() implementation to the top of the
// list
case $hook:
$group = $implementations[$my_module];
$implementations = [
$my_module => $group,
] + $implementations;
break;
}
}
// Source: https://drupal.stackexchange.com/questions/186506/how-to-reduce-increase-modules-weight-on-the-module-install-process/197097
// Bonus: https://www.drupal.org/project/modules_weight