Date Published: March 16, 2022
How to update to drupal/core-composer-scaffold in Drupal 8
Before doing this update you need to make sure your Drupal core is 8.8 or higher then follow the steps below:
1. Remove drupal-composer/drupal-scaffold
from your project:
composer remove drupal-composer/drupal-scaffold
2. Modify your composer.json
and remove any instant of drupal-scaffold
located if your extra
or scripts
section like the following:
Note: The following does not work with the new scaffold project.
"drupal-scaffold": {
"excludes": [ ".htaccess", "robots.txt" ]
},
3. Install the drupal/core-composer-scaffold
by running the following command:
composer require drupal/core-composer-scaffold:^8.8 --no-update
4. You must define where the web root is located. It does so via the locations mapping, as shown below:
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "./docroot"
},
...
}
}
5. You might prefer to entirely replace a scaffold file provided by a dependency, and receive no further updates for it. You can do this by adding the following:
"extra": {
"drupal-scaffold": {
"file-mapping": {
"[web-root]/.htaccess": false
}
}
}
6. Run the following to update your lock file:
7. If you are still using drupal/core
in your composer.json
, simply remove it and add drupal/core-recommended
:
composer remove drupal/core
composer require drupal/core-recommended:^8.8
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.