Composer equivalent to NPM package.json files property?

Hi all,

Is there exists an equivalent from NPM package.json files property in Composer?

In other words:
Can I define specific folders or files for the publishing of my production files only of my PHP composer package?

Best regards,
Mario

The files property controls what files will be included in the dependencies. Composer can also have files key in its JSON file:

https://getcomposer.org/doc/04-schema.md#files

But since it’s PHP, the “files” controls what files will be autoloaded when the package is loaded into PHP memory. Does that help?

1 Like