Creating our own plugins
So far, we've been installing external plugins that live in our node_modules
folder. Strapi also provides us with a way to build local plugins. Functionality-wise, these are similar to external ones, except that they're part of our project and can't be readily reused in other projects.
So, let's create our first plugin, as follows:
- If you are following along from the previous section, then stop the server to make sure that
NODE_ENV
is not set toproduction
, then start the server using theyarn develop
command. - To create a new plugin, we can use the CLI to generate its skeleton. Let's run the following command:
yarn strapi generate plugin lms
Running the preceding command will generate a plugin skeleton for us.
- Next, we will need to enable the plugin by adding it to the
config/plugins.js
file. Create this file and add the following code to it:module.exports = { // ... 'lms&apos...