How to export the config files of a content type to a module? I have a custom module. I created a content type and added some fields to that content type. I also enabled the layout builder on the manage display of the content type

Then I run drush -y cex to export the config files.

Then I copy all the config files related to my content type to the module's config/install director

Now if I make some changes to content type, their config files should be added/updated/exported in/to the module's config/install directory and should not be added to the site's default sync directory.

Is this possible?
You can do exactly this with the Features module.


  Features provides a UI and API for taking different site building components from modules with exportables and bundling them together in a single feature module. A feature module is like any other Drupal module except that it contains additional information in its info file so that configuration can be checked, updated, or reverted programmatically.


While ignoring the related config from configuration management with Config Ignore at the same time. Which also takes wildcards so you don't have to enter every single config object by hand.