Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding details for enabling plugin in strapi. #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebscholl
Copy link

No description provided.

@sebscholl sebscholl requested a review from a team as a code owner March 9, 2023 19:17
@erikpena
Copy link
Contributor

erikpena commented Mar 9, 2023

Hello @sebscholl ! Thank you for submitting this PR. I too had encountered this during the development of the plug-in. I believe this step is only needed if you are adding the plug-in through the plugins folder (not when you install via npm). It might be worthwhile to mention that and potentially add a link back to Strapi's docs for this configuration--

https://docs.strapi.io/dev-docs/configurations/plugins

@sebscholl
Copy link
Author

Hey @erikpena - I believe the enablement of a plugin is always required. All plugins (unless developed locally) get installed using a package manager like NPM or Yarn. However, just installing the plugin doesn't enable it in your application. You must then go enable it as shown in the changes I submitted and provide any required config.

@erikpena
Copy link
Contributor

Hey @sebscholl, thank you for the note. I just tried installing the plugin this last week and was able to use it without the config settings for this PR. The only thing that I really needed to do was delete the pre-compiled build directory that Strapi creates when it first launches. My guess here is that Strapi will skip over the plugin if the build directory already exists (I have an FAQ for this particular scenario)

@sebscholl
Copy link
Author

sebscholl commented Jun 12, 2023

Weird! Thanks for pointing this out. If the dependency is being auto-injected to the app, I'm unclear on what the enable key is there for.

However, if you're admin you is pre-built and, it's file components are directly importing the installed dependencies. Therefore, simply deleting the package and plugin config won't re-build the admin UI, and reinstalling the package will then give the built components access to the package files.

What makes sense to me, on a clean install is:

Install

  1. Empty project
  2. Install plugin (NPM)
  3. Enable plugin (plugins.js)
  4. Build Admin UI

Uninstall

  1. Uninstall plugin (NPM)
  2. Disable plugin (plugin.js)
  3. Build Admin UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants