We highly recommend using our Composer Project Template to build and maintain your WxT derived project’s codebase.
The following command is all you need to get started:
composer create-project drupalwxt/wxt-project:4.3.4 <site-name>
Note: For development you may also specify a branch using
You can see a working example of a fully generated Composer Project Template over at:
Where the following is the command that was used for the initial generation:
composer create-project drupalwxt/wxt-project:4.3.4 site-wxt
Note: Remember to keep the
composer.lockfiles that exist above
docrootin source control as they are controlling your dependencies.
List of common commands are as follows:
|Installing a contrib project (latest version)|
|Installing a contrib project (specific version)|
|Updating all projects including Drupal Core|
|Updating a single contrib project|
|Updating Drupal Core|
Note: Composer is a dependency manager and helps us keep track of what code and at what version our application relies on so that it always get installed the right way on every copy of that application.
Specifying a version
A specific version can be specified from the cli:
composer require drupal/<modulename>:<version>
However please note if you specify a branch, such as 1.x you must add
-dev to the end of the version:
composer require drupal/token:1.x-dev
Taking a look at the
.gitignore file, you will discover that certain directories, including all those directories containing contributed projects, are excluded from source control which is by design.
Note: Unlike Drush in a Composer derived project you should never commit your install dependencies to source control.
Composer will create
composer.lock file, which is a list of dependencies that were installed, and in which versions.
Note: In general you should always commit your
composer.lockfile to source control so that others via a quick
composer installcan have everything installed along with the correct versions specified in the
How to update Drupal Core?
Please don’t add
drupal/core to your project’s composer.json since WxT manages Drupal Core for you along with the series of patches on top of it.
WxT’s minor versions will always correspond to Drupal Core’s. For example,
drupalwxt/wxt:~4.5.x will require Drupal Core 9.5.x and
drupalwxt/wxt:~4.4.x required Drupal Core 9.4.x.
When you need to update Drupal Core as an example from 9.4.x to 9.5.x, all you would do is change your requirement for
drupalwxt/wxt in your
composer require --no-update drupalwxt/wxt:~4.4.0 composer update
|Drupal Core version||Drush version|
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.