Submitted by
Dmitro
on
// Install optional config.
$path_to_module = \Drupal::service('extension.path.resolver')->getPath('module', 'dev_tools');
$config_path = $path_to_module . '/config';
$config_source = new FileStorage($config_path);
\Drupal::service('config.installer')->installOptionalConfig($config_source);