Skip to content

Instantly share code, notes, and snippets.

@cristiroma
Created December 12, 2024 09:12
Show Gist options
  • Save cristiroma/020fdeca3023b3eb4a4885b69b49a70e to your computer and use it in GitHub Desktop.
Save cristiroma/020fdeca3023b3eb4a4885b69b49a70e to your computer and use it in GitHub Desktop.
How to develop custom module - Symlink local repository
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8",
"exclude": [ "drupal/YOUR_MODULE" ]
},
{
"type": "path",
"url": "../YOUR_MODULE_GIT_CHECKOUT_DIRECTORY"
}
],
"minimum-stability": "dev",
@cristiroma
Copy link
Author

  1. Use "exclude": [ "drupal/YOUR_MODULE" ] - to avoid installing from public repo
  2. Define repository path
  3. Checkout your module Git repository (and create a composer.json inside if does not exist yet), example:
{
    "name": "drupal/YOUR_MODULE",
    "type": "drupal-module",
    "minimum-stability": "dev",
    "require": {}
}
  1. Use composer require drupal/YOUR_MODULE to symlink module to project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment