Skip to content

Commit 82747d0

Browse files
feat: add environment variable for esbuild (#1914)
1 parent 5f792be commit 82747d0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/lib/build.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { env } = require('process')
2+
13
const build = require('@netlify/build')
24

35
// We have already resolved the configuration using `@netlify/config`
@@ -10,7 +12,19 @@ const getBuildOptions = ({ context, token, flags }) => {
1012
// buffer = true will not stream output
1113
const buffer = flags.json || flags.silent
1214

13-
return { cachedConfig: serializedConfig, token, dry, debug, mode: 'cli', telemetry: false, buffer }
15+
// @todo Remove once esbuild has been fully rolled out.
16+
const featureFlags = env.NETLIFY_EXPERIMENTAL_ESBUILD ? 'buildbot_esbuild' : undefined
17+
18+
return {
19+
cachedConfig: serializedConfig,
20+
token,
21+
dry,
22+
debug,
23+
mode: 'cli',
24+
telemetry: false,
25+
buffer,
26+
featureFlags,
27+
}
1428
}
1529

1630
const runBuild = async (options) => {

0 commit comments

Comments
 (0)