XF 2.3 Does the addon release zip file exclude development packages?

When you use the XenForo CLI to build an addon (using the php cmd.php xf-addon:build command), it looks at your composer.json file. If the command isn't configured correctly or if your dependencies aren't separated, the build process pulls in everything in the vendor folder.

Are you using a build.json file to exclude specific files or directories from the final zip?
 
When you use the XenForo CLI to build an addon (using the php cmd.php xf-addon:build command), it looks at your composer.json file. If the command isn't configured correctly or if your dependencies aren't separated, the build process pulls in everything in the vendor folder.

Are you using a build.json file to exclude specific files or directories from the final zip?
I currently don't do this; do you mean I need to add a "exec": ["composer install --production"]?
 
See my tutorial on how to use composer packages in addons:


Here is the command I run in my build.json if I use composer:

JSON:
{
    "exec": [
        "composer install --working-dir=_build/upload/src/addons/{addon_id}/ --no-dev --optimize-autoloader"
    ]
}

The --no-dev flag is the important part.

If I use composer only for development purposes and don't have any composer packages being shipped with the addon, I'll do this instead:

JSON:
{
    "exec": [
        "rm -v _build/upload/src/addons/{addon_id}/composer.json",
        "rm -v _build/upload/src/addons/{addon_id}/composer.lock",
        "rm -v -r _build/upload/src/addons/{addon_id}/vendor",
        "rm -v _build/upload/src/addons/{addon_id}/phpunit.xml",
        "rm -v -r _build/upload/src/addons/{addon_id}/tests",
    ]
}

... obviously if you're not using phpunit or don't have a tests directory, then you don't need those lines.
 
Back
Top Bottom