Skip to content

Commit 45b1f1c

Browse files
authored
chore: clarify comment about plugin version selection (#6459)
1 parent ec13d2c commit 45b1f1c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/build/src/plugins/list.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,8 @@ const normalizePluginsList = function (pluginsList: PluginListEntry[]) {
120120
) as PluginList
121121
}
122122

123-
/**
124-
* `version` in `plugins.json` is the latest version.
125-
* A `compatibility` array of objects can be added to specify conditions to
126-
* apply different versions.
127-
* `netlify/plugins` ensures that `compatibility`:
128-
* - Has the proper shape.
129-
* - Is sorted from the highest to lowest version.
130-
* - Does not include the latest `version`.
131-
*/
123+
// When `compatability` array is present it takes precedence, otherwise top-level `version` field is used as latest version
124+
// Plugin data comes from @netlify/plugins
132125
const normalizePluginItem = function ({ package: packageName, version, compatibility = [] }: PluginListEntry) {
133126
const versions = compatibility.length === 0 ? [{ version }] : compatibility
134127
const versionsA = versions.map(normalizeCompatVersion)

0 commit comments

Comments
 (0)