1

Is is possible to enable certain plugins only in devMode? (or via some other configuration option)?

1
2

I just was pointed to the correct solution (shame on me I did not find it myself):

There already is a config for this: https://docs.craftcms.com/v3/config/config-settings.html#disabledplugins

To be used like this:

'production' => [
     'disabledPlugins' => ['cloner', 'cp-field-inspect', 'dumper', 'migration-manager']
],

Thanks gtettelaar for dropping me a hint! (https://github.com/craftcms/cms/issues/5107)

1

No.

However if you explain more, and the reasons why you want to do this, there might be a solution.

EDIT: Based on comment

As part of my deployment, I would have a diiferent composer.json file for the production environment which would only contain the plugins you want.

Then run composer update on production. Only what you want will be included.

4
  • OK: There are certain plugins, which are useful for development, e.g. "CP Field Inspect" (which shows field handles when editing entries), but not for production. I do not want to load those plugins, when in devMode, or alternatively when ENV = production or something like that. Sep 27 '19 at 9:27
  • As a response to your changed answer: I also thought about that. But then you always need to re-enable the plugin when you clone the live database to your local one. Sep 27 '19 at 12:25
  • @MatthiasRedl-Mann my deployments are all scripted, so it is possible to run ./craft install/plugin PLUGINNAME to automate that also Sep 27 '19 at 14:41
  • same for me, but this does not solve my problem: I either always need to re-enable the plugin locally after having drawn a dump or I need to script this. It's simply the wrong direction.... thanks anyway Oct 7 '19 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.