@netlify/build 29.4.0 → 29.4.88-test
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.
|
@@ -6,9 +6,10 @@ import { logBundleResults, logFunctionsNonExistingDir, logFunctionsToBundle } fr
|
|
|
6
6
|
import { getZipError } from './error.js';
|
|
7
7
|
import { getUserAndInternalFunctions, validateFunctionsSrc } from './utils.js';
|
|
8
8
|
import { getZisiParameters } from './zisi.js';
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// Get a list of all unique bundlers in this run
|
|
10
|
+
const getBundlers = (results = []) => Array.from(new Set(results
|
|
11
|
+
.map((bundle) => (bundle.runtime === "js" /* RuntimeType.JAVASCRIPT */ ? bundle.bundler : null))
|
|
12
|
+
.filter(Boolean)));
|
|
12
13
|
const zipFunctionsAndLogResults = async ({ buildDir, childEnv, featureFlags, functionsConfig, functionsDist, functionsSrc, internalFunctionsSrc, isRunningLocally, logs, repositoryRoot, }) => {
|
|
13
14
|
const zisiParameters = getZisiParameters({
|
|
14
15
|
buildDir,
|
|
@@ -20,14 +21,14 @@ const zipFunctionsAndLogResults = async ({ buildDir, childEnv, featureFlags, fun
|
|
|
20
21
|
isRunningLocally,
|
|
21
22
|
repositoryRoot,
|
|
22
23
|
});
|
|
23
|
-
const bundler = isUsingEsbuild(functionsConfig) ? 'esbuild' : 'zisi';
|
|
24
24
|
try {
|
|
25
25
|
// Printing an empty line before bundling output.
|
|
26
26
|
log(logs, '');
|
|
27
27
|
const sourceDirectories = [internalFunctionsSrc, functionsSrc].filter(Boolean);
|
|
28
28
|
const results = await zipItAndShipIt.zipFunctions(sourceDirectories, functionsDist, zisiParameters);
|
|
29
|
+
const bundlers = getBundlers(results);
|
|
29
30
|
logBundleResults({ logs, results });
|
|
30
|
-
return {
|
|
31
|
+
return { bundlers };
|
|
31
32
|
}
|
|
32
33
|
catch (error) {
|
|
33
34
|
throw await getZipError(error, functionsSrc);
|
|
@@ -39,7 +40,7 @@ const coreStep = async function ({ childEnv, constants: { INTERNAL_FUNCTIONS_SRC
|
|
|
39
40
|
const functionsDist = resolve(buildDir, relativeFunctionsDist);
|
|
40
41
|
const internalFunctionsSrc = resolve(buildDir, relativeInternalFunctionsSrc);
|
|
41
42
|
const internalFunctionsSrcExists = await pathExists(internalFunctionsSrc);
|
|
42
|
-
const functionsSrcExists = await validateFunctionsSrc({ functionsSrc,
|
|
43
|
+
const functionsSrcExists = await validateFunctionsSrc({ functionsSrc, relativeFunctionsSrc });
|
|
43
44
|
const [userFunctions = [], internalFunctions = []] = await getUserAndInternalFunctions({
|
|
44
45
|
featureFlags,
|
|
45
46
|
functionsSrc,
|
|
@@ -64,7 +65,7 @@ const coreStep = async function ({ childEnv, constants: { INTERNAL_FUNCTIONS_SRC
|
|
|
64
65
|
if (userFunctions.length === 0 && internalFunctions.length === 0) {
|
|
65
66
|
return {};
|
|
66
67
|
}
|
|
67
|
-
const {
|
|
68
|
+
const { bundlers } = await zipFunctionsAndLogResults({
|
|
68
69
|
buildDir,
|
|
69
70
|
childEnv,
|
|
70
71
|
featureFlags,
|
|
@@ -78,7 +79,7 @@ const coreStep = async function ({ childEnv, constants: { INTERNAL_FUNCTIONS_SRC
|
|
|
78
79
|
});
|
|
79
80
|
return {
|
|
80
81
|
tags: {
|
|
81
|
-
bundler,
|
|
82
|
+
bundler: bundlers,
|
|
82
83
|
},
|
|
83
84
|
};
|
|
84
85
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "29.4.
|
|
3
|
+
"version": "29.4.88-test",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/core/main.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@netlify/edge-bundler": "8.0.0",
|
|
70
70
|
"@netlify/functions-utils": "^5.1.1",
|
|
71
71
|
"@netlify/git-utils": "^5.1.0",
|
|
72
|
-
"@netlify/plugins-list": "^6.
|
|
72
|
+
"@netlify/plugins-list": "^6.61.0",
|
|
73
73
|
"@netlify/run-utils": "^5.1.0",
|
|
74
74
|
"@netlify/zip-it-and-ship-it": "^8.2.0",
|
|
75
75
|
"@sindresorhus/slugify": "^2.0.0",
|
|
@@ -148,6 +148,5 @@
|
|
|
148
148
|
"compilerOptions": {
|
|
149
149
|
"module": "commonjs"
|
|
150
150
|
}
|
|
151
|
-
}
|
|
152
|
-
"gitHead": "87d6d9344ac37b4c40b70c582958347c0f7fd8eb"
|
|
151
|
+
}
|
|
153
152
|
}
|