Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shopware 6 delete specific files from vendor

When I run build-administration I get the following error during the step "Calling reporter service for single check."

ERROR in unable to locate '/var/www/vendor/store.shopware.com/netinexteasycoupondesigns/src/Resources/app/administration/static/**/*' glob

The vendor of the plugin recommended to delete the path src/Resources/app inside the plugins source files. Since they're installed via composer I'm not able to delete these files persistently e.g. on production or other environments.

How can I persist these changes? With a composer patch, or is there any other way?

like image 661
NixH Avatar asked Sep 11 '25 06:09

NixH


1 Answers

WARNING: This does not work as intended

This answer is probably invalid, we are investigating, but using this method, some important parts seem to be missing from the build.

I let this answer stand as a warning an hope, someone will provide a better answer


Original answer:

We assume you have certain 3rd party plugins which don't need to be built, as well as some own project specific plugins which need building.

If we take a look build-administration.sh, it normally executed bundle:dump which would write the var/plugin.json which determined which packages to build in the build process. The file is usually not committed to the git repository.

Do not build 3rd party dependencies

The following approach would work to avoid building 3rd party dependencies.

  • Add var/plugins.json to the git
  • Remove all non-custom modules from plugins.json
  • Call SHOPWARE_SKIP_BUNDLE_DUMP=1 bin/build-administration.sh to avoid rebuilding the plugins.json

You have to remember to add new custom plugins manually to the file. Probably the easiest way is to call bundle:dump again then remove the 3rd party modules.

Another option might be to generate the plugins.json before the build using bundle:dump and then filter the file using jq. But I did not test this.

Depending on the number of plugins, this will also speed up the build process.

like image 168
Alex Avatar answered Sep 14 '25 20:09

Alex