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

fix(plugins): Update plugins collection based on the RFC dependency name format #18135

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/next/build/plugins/collect-plugins.ts
Expand Up @@ -183,8 +183,19 @@ async function _collectPlugins(

// find packages with the naming convention
// @next/plugin-[name]
// @<scope>/next-plugin-[name]
// next-plugin-[name]
const filteredDeps = dependencies.filter((name) => {
return name.match(/^@next\/plugin/)
return (
name.match(/^@next\/plugin-[a-z0-9.-_]+/) ||
name.match(/^next-plugin-[a-z0-9.-_]+/) ||
/**
* URL-safe characters (dot, dash, underscore), lower-case only, no leading dots or underscores.
* https://docs.npmjs.com/using-npm/scope.html
* https://docs.npmjs.com/files/package.json
*/
name.match(/^@[a-z0-9-][a-z0-9.-_]*\/next-plugin-[a-z0-9.-_]+/)
)
})

if (nextPluginConfigNames) {
Expand Down