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

Only load plugins with @next prefix #17945

Merged
merged 2 commits into from Oct 16, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions packages/next/build/plugins/collect-plugins.ts
Expand Up @@ -182,11 +182,9 @@ async function _collectPlugins(
}

// find packages with the naming convention
// @scope/next-plugin-[name]
// @next/plugin-[name]
// next-plugin-[name]
const filteredDeps = dependencies.filter((name) => {
return name.match(/(^@next\/plugin|next-plugin-)/)
return name.match(/^@next\/plugin/)
})

if (nextPluginConfigNames) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions test/integration/next-plugins/app/package.json
@@ -1,7 +1,5 @@
{
"dependencies": {
"@next/plugin-google-analytics": "latest",
"@zeit/next-plugin-scope": "latest",
"next-plugin-normal": "latest"
"@next/plugin-google-analytics": "latest"
}
}
4 changes: 0 additions & 4 deletions test/integration/next-plugins/test/index.test.js
Expand Up @@ -44,8 +44,6 @@ function runTests() {

it('should list loaded plugins', async () => {
expect(stdout).toMatch(/loaded plugin: @next\/plugin-google-analytics/i)
expect(stdout).toMatch(/loaded plugin: @zeit\/next-plugin-scope/i)
expect(stdout).toMatch(/loaded plugin: next-plugin-normal/i)
})

it('should ignore directories in plugins', async () => {
Expand Down Expand Up @@ -111,8 +109,6 @@ describe('Next.js plugins', () => {

it('should disable auto detecting plugins when plugin config is used', async () => {
expect(stdout).toMatch(/loaded plugin: @next\/plugin-google-analytics/i)
expect(stdout).not.toMatch(/loaded plugin: @zeit\/next-plugin-scope/i)
expect(stdout).not.toMatch(/loaded plugin: next-plugin-normal/i)
})

it('should expose a plugins config', async () => {
Expand Down