fix(plugin generator): support valid package names for pluginId

Update the current replace regex to support both scoped package and old strapi plugin names.
This commit is contained in:
daedalus 2022-01-15 22:25:13 -05:00
parent ce09d38972
commit f7dc4be726

View File

@ -1,5 +1,5 @@
const pluginPkg = require('../../package.json');
const pluginId = pluginPkg.name.replace(/^@strapi\/plugin-/i, '');
const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, '');
module.exports = pluginId;