Sage Composer install Soil

Hi, can you tell me please whether there is a way to set the Soil in the themes/sage/vendor/roots, as well as the roots/wp-password-bcrypt?

Why are you installing WordPress plugins into your theme?


There are several reasons:

I think that such a plug-in as Soil belongs to the category of plug-ins like the controller, which should be in the subject, since they are closely related to it. Even the fact that the app/setup.php already has actions written, and the plug-in needs to be installed separately, I’m a little confused …

The second reason is that I put trellis/bedrock/sage, and in bedrock/composer.js dependency Soil is being created, and when the build is on production, Soil is for some reason installed in two places site/web/app/plugins - as expected , and site/web/app/themes/sage/wp-content/plugins/... - what was not expected …

Well, a third reason, I think that it would be much more convenient to write in the dependencies of the theme necessary plug-ins and when assembling for production they will all be installed …

Soil is a WP plugin, so it belongs in the plugin folder.

Did you run composer install both in Bedrock AND Sage? If you’re making a Bedrock project, all dependencies can go in the Bedrock Composer file, since Sage doesn’t depend on Soil itself. If you are making the theme independent of the Bedrock installation, then yes you could add Soil to the Sage Composer file, but then it would be required to install the theme from the Bedrock or main Composer file. It should install all dependencies in the correct place.

The thing is, since WP itself does not support Composer, you need to use Composer if you want to use Composer dependencies in your theme.

Some people have added plugins to their Sage theme and changed the install path to go out of the theme folder and into the plugin folder, but that seems really icky to me.


├── site/
└── trellis/

I did not run the composer at all, I just ran ./bin/ production, composer require roots/soil it was only written in site/composer.json. On Soil sarver, was installed both in site/web/app/plugins and in themes/sage /wp-content/....

I deleted sage/wp-content/..., and re-compiled several times, the result was the same Soil was put in 2 places.

@kalenjohnson In any case, thanks for the help!