Skip to content
Oleksandr Horbatiuk edited this page May 23, 2021 · 15 revisions

Example of "composer.json" file for project

{
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "chmez/d8": "0.9.0.95",
        "drush/drush": "~8.0",
        "slowprog/composer-copy-file": "0.2.1",
        "sozarch/bootstrap-sass": "3.3.7",
        "wikimedia/composer-merge-plugin": "2.0.1"
    },
    "require-dev": {
        "drupal/console": "~1.0"
    },
    "scripts": {
        "post-install-cmd": [
            "@composer drupal:scaffold",
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ],
        "post-update-cmd": [
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ]
    },
    "extra": {
        "installer-paths": {
            "core": [
                "drupal/core"
            ],
            "modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "sites/all/libraries/{$name}": [
                "type:drupal-library"
            ]
        },
        "enable-patching": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "copy-file": {
            "vendor/sozarch/bootstrap-sass/scss/_variables.scss": "profiles/contrib/d8/themes/custom/d8_theme/sass/"
        },
        "merge-plugin": {
            "include": "profiles/contrib/d8/composer.json",
            "recurse": true,
            "replace": false,
            "ignore-duplicates": false,
            "merge-dev": true,
            "merge-extra": false,
            "merge-extra-deep": false,
            "merge-scripts": false
        }
    }
}
Clone this wiki locally