createPluginsJs after copyCustomAdmin (#6626)

Signed-off-by: ddhp <jessechen.jcc@gmail.com>
This commit is contained in:
Jian-Chen Chen (jesse) 2020-06-19 01:07:09 +08:00 committed by GitHub
parent d864c2c574
commit ac5b4fdf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,14 +198,14 @@ async function createCacheDir(dir) {
// copy plugins code
await Promise.all(pluginsToCopy.map(name => copyPlugin(name, cacheDir)));
// create plugins.js with plugins requires
await createPluginsJs(pluginsToCopy, localPluginsToCopy, cacheDir);
// override admin code with user customizations
if (fs.pathExistsSync(path.join(dir, 'admin'))) {
await copyCustomAdmin(path.join(dir, 'admin'), cacheDir);
}
// create plugins.js with plugins requires
await createPluginsJs(pluginsToCopy, localPluginsToCopy, cacheDir);
// override plugins' admin code with user customizations
const pluginsToOverride = pluginsToCopy.reduce((acc, current) => {
const pluginName = current.replace(/^strapi-plugin-/i, '');