a dumb question.
From: https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html
Magento installs third-party components in the
<Magento install directory>/vendor
directory. But we recommend adding your components to the<Magento install directory>/app/code
directory. If you add your component to the<Magento install directory>/vendor directory
, Git will ignore it because Magento adds the vendor directory to the<Magento install directory>/.gitignore
file.
Why is it recommended to put code into app/code
instead of creating a git repo and add it via composer.json
?
All my code lives in repos. I do my changes there and just adjust composer.josn
/composer.lock
for my magento project.
I only see downsides using app/code
directly. It's not update-safe as composer requirements are ignored. It makes my the repo bigger. I have an "unclean" commit log (even with squashed commits that only belong to extensions).
- What are the PROs and CONs of using
app/code
? - What are the PROs and CONs of using
composer
?