I am trying to delete a configuration from a module in hook_uninstall. My module creates a content type bundle which has to be deleted. I tried to use an approach described here: How to delete a content type, programmatically? but without luck, the content type still exists.
dependencies: enforced: module: - modulename
Of course, I delete entities of the given type before uninstall. Is there any way to do it programmatically: delete a content type with fields?