How to exclude a module from being uninstalled during import? On my local I have installed my custom module which depends on a contrib module.
I have removed both modules from the core.extensions.yml and added the following to settings.local.php.
$settings['config_exclude_modules'] = ['contrib_module', 'mymodule'];

But when I execute drush cim, both of the modules get uninstalled.
But I can read this specifically.

When syncing configuration, if an excluded module is already
installed, it will not be uninstalled by the configuration
synchronisation, and dependent configuration will remain   intact.

Do I need to execute some command after adding it to the settings.php? Why it is not working.
This will only work with drush 10. So drush should be updated to version 10.
With drush version lower than 10, it will work only from the UI.