@netlify/zip-it-and-ship-it 4.23.2 → 4.23.3
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
|
@@ -4,6 +4,11 @@ const { tmpName } = require('tmp-promise')
|
|
|
4
4
|
|
|
5
5
|
const { safeUnlink } = require('../../utils/fs')
|
|
6
6
|
|
|
7
|
+
// Maximum number of log messages that an esbuild instance will produce. This
|
|
8
|
+
// limit is important to avoid out-of-memory errors due to too much data being
|
|
9
|
+
// sent in the Go<>Node IPC channel.
|
|
10
|
+
const ESBUILD_LOG_LIMIT = 10
|
|
11
|
+
|
|
7
12
|
const getListImportsPlugin = ({ imports, path }) => ({
|
|
8
13
|
name: 'list-imports',
|
|
9
14
|
setup(build) {
|
|
@@ -35,11 +40,14 @@ const listImports = async ({ path }) => {
|
|
|
35
40
|
|
|
36
41
|
try {
|
|
37
42
|
await esbuild.build({
|
|
38
|
-
entryPoints: [path],
|
|
39
43
|
bundle: true,
|
|
44
|
+
entryPoints: [path],
|
|
45
|
+
logLevel: 'error',
|
|
46
|
+
logLimit: ESBUILD_LOG_LIMIT,
|
|
40
47
|
outfile: targetPath,
|
|
41
48
|
platform: 'node',
|
|
42
49
|
plugins: [getListImportsPlugin({ imports, path })],
|
|
50
|
+
target: 'esnext',
|
|
43
51
|
})
|
|
44
52
|
} finally {
|
|
45
53
|
await safeUnlink(targetPath)
|