@netlify/build 27.16.1 → 27.16.2-pidgey

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "27.16.1",
3
+ "version": "27.16.2-pidgey",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -1,4 +1,6 @@
1
- import { resolve } from 'path'
1
+ import { promises as fs } from 'fs'
2
+ import path, { resolve } from 'path'
3
+ import process from 'process'
2
4
 
3
5
  import { zipFunctions } from '@netlify/zip-it-and-ship-it'
4
6
  import { pathExists } from 'path-exists'
@@ -26,6 +28,7 @@ const zipFunctionsAndLogResults = async ({
26
28
  isRunningLocally,
27
29
  logs,
28
30
  repositoryRoot,
31
+ publishDir,
29
32
  }) => {
30
33
  const zisiParameters = getZisiParameters({
31
34
  buildDir,
@@ -44,6 +47,13 @@ const zipFunctionsAndLogResults = async ({
44
47
 
45
48
  const sourceDirectories = [internalFunctionsSrc, functionsSrc].filter(Boolean)
46
49
  const results = await zipItAndShipIt.zipFunctions(sourceDirectories, functionsDist, zisiParameters)
50
+ if (process.env.NF_BUNDLE_FOR_FLY === 'true') {
51
+ const destDir = path.join(publishDir, '.netlify/internal/fly-functions')
52
+ await fs.mkdir(destDir, { recursive: true })
53
+ await Promise.all(
54
+ results.map((result) => fs.copyFile(result.path, path.join(destDir, path.basename(result.path)))),
55
+ )
56
+ }
47
57
 
48
58
  logBundleResults({ logs, results })
49
59
 
@@ -62,6 +72,7 @@ const coreStep = async function ({
62
72
  IS_LOCAL: isRunningLocally,
63
73
  FUNCTIONS_SRC: relativeFunctionsSrc,
64
74
  FUNCTIONS_DIST: relativeFunctionsDist,
75
+ PUBLISH_DIR: publishDir,
65
76
  },
66
77
  buildDir,
67
78
  logs,
@@ -114,6 +125,7 @@ const coreStep = async function ({
114
125
  isRunningLocally,
115
126
  logs,
116
127
  repositoryRoot,
128
+ publishDir,
117
129
  })
118
130
 
119
131
  return {