I'm using latest version of preserve-path i.e 0.1.6.
I have following code for my D7 project:
"installer-paths": {
"dist/": [ "type:drupal-core" ],
"dist/sites/all/libraries/{$name}": [ "type:drupal-library"],
"dist/sites/all/modules/custom/{$name}": [ "type:drupal-custom-module" ],
"dist/sites/all/modules/contrib/{$name}": [ "type:drupal-module" ],
"dist/sites/all/themes/shared/{$name}": [ "type:drupal-custom-theme" ],
"dist/sites/all/themes/contrib/{$name}": [ "type:drupal-theme" ]
},
"preserve-paths": [
"dist/sites/myproject.com
]
There are already custom modules in dist/sites/myproject.com/modules/custom/module_name location which needs to be there everytime but whenever I do composer update or install it removes "dist" directory and again setup. It is not preserving the path which I have define to preserve.