Disable automatically php deploy

Im trying to deploy a repository that contains both backend and frontend code, the frontend code is a typical npm project and the backed contains PHP(laravel) with composer.

The problem is that I just want to run npm for the backend when deploying but netlify is detecting my php composer and trying to install the dependencies, that, of course, is creating an error.

Any way to disable that? already look in the docs, forums, google, etc, tried to use the netlify.toml file without any luck.


The too smart build robots strike again :expressionless:

I don’t think there is a straightforward way to do that. There are some hackish ways:

  1. reorganize your codebase and use monorepo support: https://www.netlify.com/blog/2019/10/09/launching-monorepo-support-for-netlify-sites/ (I am not asking you to do this! Just saying it is a possible, heavyweight, suboptimal, but possible solution)
  2. do something “tricky” like set a base directory that doesn’t have composer config in it, and then have a build command like cd .. ; npm install && do-your-build. This will break our dependency caching, though, so your builds will have to npm install freshly every time.

Wish I had better news for you…