How to use the strapi-admin.createPluginsJs function in strapi-admin

To help you get started, we’ve selected a few strapi-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi / lib / commands / watch.js View on Github external
// The plugins.js file needs to be recreated
            // when we delete either the admin folder
            // the admin/src folder
            // or the plugins.js file
            // since the path are different when developing inside the monorepository or inside an app
            const shouldCopyPluginsJSFile =
              filePath.split('/admin/src').filter(p => !!p).length === 1;

            if (
              (event === 'unlinkDir' &&
                !isExtension &&
                shouldCopyPluginsJSFile) ||
              (!isExtension && filePath.includes('plugins.js'))
            ) {
              await strapiAdmin.createPluginsJs(
                appPlugins,
                path.join(cacheDir)
              );
            }
          } catch (err) {
            // Do nothing
          }
        }
      } else {
        // In any other case just copy the file into the .cache folder
        try {
          await fs.copy(filePath, path.join(destFolder, targetPath));
        } catch (err) {
          console.log(err);
        }
      }

strapi-admin

Strapi Admin

SEE LICENSE IN LICENSE
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis

Similar packages