PHPackages                             drupal-composer/preserve-paths - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drupal-composer/preserve-paths

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

drupal-composer/preserve-paths
==============================

Composer plugin for preserving custom paths and supporting nested packages

0.1.6(5y ago)271.1M↓36.8%27[10 issues](https://github.com/drupal-composer/preserve-paths/issues)[3 PRs](https://github.com/drupal-composer/preserve-paths/pulls)5GPL-2.0-or-laterPHPCI failing

Since Dec 27Pushed 2y ago4 watchersCompare

[ Source](https://github.com/drupal-composer/preserve-paths)[ Packagist](https://packagist.org/packages/drupal-composer/preserve-paths)[ Docs](https://github.com/drupal-composer/preserve-paths)[ RSS](/packages/drupal-composer-preserve-paths/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (8)Used By (5)

Composer preserve paths
=======================

[](#composer-preserve-paths)

Composer plugin for preserving paths while installing, updating or uninstalling packages.

This way you can:

- provide custom files or directories that will not be overwritten on `composer install` or `composer update`
- place packages within the directory of another package (using a composer installer like [composer/installers](https://packagist.org/packages/composer/installers) or [davidbarratt/custom-installer](https://packagist.org/packages/davidbarratt/custom-installer))

Installation
------------

[](#installation)

Simply install the plugin with composer: `composer require drupal-composer/preserve-paths`

Configuration
-------------

[](#configuration)

For configuring the paths you need to set `preserve-paths` within the `extra` of your root `composer.json`.

```
{
    "extra": {
        "preserve-paths": [
          "web/sites/all/modules/contrib",
          "web/sites/all/themes/contrib",
          "web/sites/all/libraries",
          "web/sites/all/drush"
        ]
      }
}
```

Example
-------

[](#example)

An example composer.json using [composer/installers](https://packagist.org/packages/composer/installers):

```
{
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/7"
    }
  ],
  "require": {
    "composer/installers": "^1.2",
    "drupal-composer/preserve-paths": "0.1.*",
    "drupal/views": "3.*",
    "drupal/drupal": "7.*"
  },
  "config": {
    "vendor-dir": "vendor"
  },
  "extra": {
    "installer-paths": {
      "web/": ["type:drupal-core"],
      "web/sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
      "web/sites/all/themes/contrib/{$name}/": ["type:drupal-theme"],
      "web/sites/all/libraries/{$name}/": ["type:drupal-library"],
      "web/sites/all/drush/{$name}/": ["type:drupal-drush"],
      "web/profiles/{$name}/": ["type:drupal-profile"]
    },
    "preserve-paths": [
      "web/sites/all/modules/contrib",
      "web/sites/all/themes/contrib",
      "web/sites/all/libraries",
      "web/sites/all/drush",
      "web/sites/default/settings.php",
      "web/sites/default/files"
    ]
  }
}
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~358 days

Recently: every ~494 days

Total

7

Last Release

2056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c711eb409734c42befd3bb9d507be67da46d0db9bd03c5172c8fe2da1705c239?d=identicon)[webflo](/maintainers/webflo)

![](https://www.gravatar.com/avatar/5613deedd974152f066c46795af9d5dd85cb84bd0c05ebb921287479c82b0c0f?d=identicon)[derhasi](/maintainers/derhasi)

---

Top Contributors

[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (67 commits)")[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (3 commits)")[![markpavlitski](https://avatars.githubusercontent.com/u/3777070?v=4)](https://github.com/markpavlitski "markpavlitski (2 commits)")[![bnchdrff](https://avatars.githubusercontent.com/u/99194?v=4)](https://github.com/bnchdrff "bnchdrff (2 commits)")[![NickDickinsonWilde](https://avatars.githubusercontent.com/u/92694?v=4)](https://github.com/NickDickinsonWilde "NickDickinsonWilde (1 commits)")[![tobbexiv](https://avatars.githubusercontent.com/u/5681598?v=4)](https://github.com/tobbexiv "tobbexiv (1 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (1 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (1 commits)")[![deminy](https://avatars.githubusercontent.com/u/865547?v=4)](https://github.com/deminy "deminy (1 commits)")[![arkener](https://avatars.githubusercontent.com/u/16407031?v=4)](https://github.com/arkener "arkener (1 commits)")

---

Tags

composercomposer-plugininstallercomposer-plugincustom pathnested package

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drupal-composer-preserve-paths/health.svg)

```
[![Health](https://phpackages.com/badges/drupal-composer-preserve-paths/health.svg)](https://phpackages.com/packages/drupal-composer-preserve-paths)
```

###  Alternatives

[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1465.4M62](/packages/mnsami-composer-custom-directory-installer)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3014.6M26](/packages/vaimo-composer-patches)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M564](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.7M203](/packages/drupal-core-project-message)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)[altis/local-server

Local Server module for Altis

18221.6k3](/packages/altis-local-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
