File tree 2 files changed +1
-74
lines changed
2 files changed +1
-74
lines changed Original file line number Diff line number Diff line change @@ -4,27 +4,5 @@ import { NEXT_PHASE_PRODUCTION_BUILD } from './phases';
4
4
* Decide if the currently running process is part of the build phase or happening at runtime.
5
5
*/
6
6
export function isBuild ( ) : boolean {
7
- if (
8
- // During build, the main process is invoked by
9
- // `node next build`
10
- // and child processes are invoked as
11
- // `node <path>/node_modules/.../jest-worker/processChild.js`.
12
- // The former is (obviously) easy to recognize, but the latter could happen at runtime as well. Fortunately, the main
13
- // process hits this file before any of the child processes do, so we're able to set an env variable which the child
14
- // processes can then check. During runtime, the main process is invoked as
15
- // `node next start`
16
- // or
17
- // `node /var/runtime/index.js`,
18
- // so we never drop into the `if` in the first place.
19
- process . argv . includes ( 'build' ) ||
20
- process . env . SENTRY_BUILD_PHASE ||
21
- // This is set by next, but not until partway through the build process, which is why we need the above checks. That
22
- // said, in case this function isn't called until we're in a child process, it can serve as a good backup.
23
- process . env . NEXT_PHASE === NEXT_PHASE_PRODUCTION_BUILD
24
- ) {
25
- process . env . SENTRY_BUILD_PHASE = 'true' ;
26
- return true ;
27
- }
28
-
29
- return false ;
7
+ return process . env . NEXT_PHASE === NEXT_PHASE_PRODUCTION_BUILD ;
30
8
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments