diff --git a/packages/build/tests/plugins/snapshots/tests.js.md b/packages/build/tests/plugins/snapshots/tests.js.md index f3550d1d77..44d5b5f2a9 100644 --- a/packages/build/tests/plugins/snapshots/tests.js.md +++ b/packages/build/tests/plugins/snapshots/tests.js.md @@ -2682,7 +2682,7 @@ Generated by [AVA](https://avajs.dev). -> inputs: { some_input: 'some string' }␊ -> netlifyConfig: {␊ functions: { '*': {} },␊ - plugins: [ { package: './plugin', origin: 'config', inputs: [Object] } ],␊ + plugins: [ { origin: 'config', package: './plugin', inputs: [Object] } ],␊ build: {␊ environment: {},␊ publish: 'packages/build/tests/plugins/fixtures/dynamic_plugin',␊ diff --git a/packages/build/tests/plugins/snapshots/tests.js.snap b/packages/build/tests/plugins/snapshots/tests.js.snap index a0e706ac7d..ac5cd227ab 100644 Binary files a/packages/build/tests/plugins/snapshots/tests.js.snap and b/packages/build/tests/plugins/snapshots/tests.js.snap differ diff --git a/packages/config/src/origin.js b/packages/config/src/origin.js index 4047af03fa..2ae2391061 100644 --- a/packages/config/src/origin.js +++ b/packages/config/src/origin.js @@ -26,7 +26,7 @@ const addBuildPublishOrigin = function ({ config, config: { build = {} }, origin } const addConfigPluginOrigin = function ({ config, config: { plugins }, origin }) { - return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ ...plugin, origin })) } : config + return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ origin, ...plugin })) } : config } const addHeadersOrigin = function ({ config, config: { headers }, origin }) { diff --git a/packages/config/tests/validate/snapshots/tests.js.md b/packages/config/tests/validate/snapshots/tests.js.md index 7e3c9871a0..84f821678e 100644 --- a/packages/config/tests/validate/snapshots/tests.js.md +++ b/packages/config/tests/validate/snapshots/tests.js.md @@ -71,8 +71,8 @@ Generated by [AVA](https://avajs.dev). Invalid syntax␊ ␊ [[plugins]]␊ - test = true␊ origin = "config"␊ + test = true␊ ␊ [plugins.inputs]␊ ␊ @@ -97,8 +97,8 @@ Generated by [AVA](https://avajs.dev). Invalid syntax␊ ␊ [[plugins]]␊ - id = "test"␊ origin = "config"␊ + id = "test"␊ ␊ [plugins.inputs]␊ ␊ @@ -123,9 +123,9 @@ Generated by [AVA](https://avajs.dev). Invalid syntax␊ ␊ [[plugins]]␊ + origin = "config"␊ package = "./plugin.js"␊ enabled = true␊ - origin = "config"␊ ␊ [plugins.inputs]␊ ␊ diff --git a/packages/config/tests/validate/snapshots/tests.js.snap b/packages/config/tests/validate/snapshots/tests.js.snap index fbd5c08412..4b59ad0048 100644 Binary files a/packages/config/tests/validate/snapshots/tests.js.snap and b/packages/config/tests/validate/snapshots/tests.js.snap differ