Skip to content

Commit f632c0a

Browse files
GatsbyJS Botpieh
GatsbyJS Bot
andauthored
perf(develop): don't use debug config for bluebird (#28957) (#28993)
* perf(develop): don't use debug config for bluebird * Update api-runner-node.js (cherry picked from commit 125f571) Co-authored-by: Michal Piechowiak <[email protected]>
1 parent 7e9ee09 commit f632c0a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/gatsby/src/utils/api-runner-node.js

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ const { trackBuildError, decorateEvent } = require(`gatsby-telemetry`)
3333
import errorParser from "./api-runner-error-parser"
3434
const { loadNodeContent } = require(`../db/nodes`)
3535

36+
if (!process.env.BLUEBIRD_DEBUG && !process.env.BLUEBIRD_LONG_STACK_TRACES) {
37+
// Unless specified - disable longStackTraces
38+
// as this have severe perf penalty ( http://bluebirdjs.com/docs/api/promise.longstacktraces.html )
39+
// This is mainly for `gatsby develop` due to NODE_ENV being set to development
40+
// which cause bluebird to enable longStackTraces
41+
// `gatsby build` (with NODE_ENV=production) already doesn't enable longStackTraces
42+
Promise.config({ longStackTraces: false })
43+
}
44+
3645
// Bind action creators per plugin so we can auto-add
3746
// metadata to actions they create.
3847
const boundPluginActionCreators = {}

0 commit comments

Comments
 (0)