@netlify/config 17.0.12 → 17.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/log/cleanup.js +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "17.0.12",
3
+ "version": "17.0.13",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./src/main.js",
@@ -48,7 +48,9 @@ export const cleanupConfig = function ({
48
48
  functions,
49
49
  functionsDirectory,
50
50
  })
51
- return netlifyConfig
51
+ const netlifyConfigA = truncateArray(netlifyConfig, 'headers')
52
+ const netlifyConfigB = truncateArray(netlifyConfigA, 'redirects')
53
+ return netlifyConfigB
52
54
  }
53
55
 
54
56
  export const cleanupEnvironment = function (environment) {
@@ -77,3 +79,14 @@ const cleanupPlugin = function ({ package: packageName, origin, inputs = {} }) {
77
79
  const isPublicInput = function (key, input) {
78
80
  return typeof input === 'boolean'
79
81
  }
82
+
83
+ // `headers` and `redirects` can be very long, which can take several minutes
84
+ // to print in the build logs. We truncate them before logging.
85
+ const truncateArray = function (netlifyConfig, propName) {
86
+ const array = netlifyConfig[propName]
87
+ return Array.isArray(array) && array.length > MAX_ARRAY_LENGTH
88
+ ? { ...netlifyConfig, [propName]: array.slice(0, MAX_ARRAY_LENGTH) }
89
+ : netlifyConfig
90
+ }
91
+
92
+ const MAX_ARRAY_LENGTH = 100