Search code examples
shopware6

Shopware 6: What is the usage or benefit of the custom/static-plugins folder?


Shopware 6 provides this folder structure for apps and plugins:

<shopware root>
└ custom
  ├ app
  ├ plugins
  └ static-plugins

Obviously, the app and plugins folders are meant to hold your custom apps and plugins. Also, when installed via Admin, third party plugins will be stored in the plugins folder.

It is also possible to install 3rd party plugins using composer, in which case of course they will only show up in the top-level vendor folder.

I have noted a common practice with some developers to put their own custom plugins or third-party plugins in the static-plugins folder and to composer require the plugins.

Is there any particular reason or benefit for this practice c.f. just keeping the code in custom/plugins?


Solution

  • As you already noted stated-plugins is for project specific plugins, so your plugins, while plugins is for plugins acquired from the community store. By putting your plugins in static-plugins and requiring them with composer it will let the system know that these plugins are also managed by composer and as such cannot be downloaded or updated from the store. Beside that putting your plugins inside that directory is mostly an organizational but recommended measure.