Commit 7c47074 1 parent 315d5f4 commit 7c47074 Copy full SHA for 7c47074
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,24 @@ export const baseConfig = Object.freeze({
10
10
loader : 'default' ,
11
11
} ) ;
12
12
13
+ // match Node.js debugger flags
14
+ // https://nodejs.org/api/cli.html#--inspecthostport
15
+ const NODE_DEBUGGER_FLAG_REGEX = / ^ - - i n s p e c t (?: - b r k | - p o r t | - p u b l i s h - u i d | - w a i t ) ? (?: = | $ ) / ;
16
+
17
+ const isNodeDebuggerEnabled = process . execArgv . some ( flag => NODE_DEBUGGER_FLAG_REGEX . test ( flag ) ) ;
18
+
13
19
export const cacheConfig = {
14
20
...baseConfig ,
15
21
16
22
sourcemap : true ,
17
23
18
24
/**
19
25
* Improve performance by only generating sourcesContent
20
- * when V8 coverage is enabled
26
+ * when V8 coverage is enabled or Node.js debugger is enabled
21
27
*
22
28
* https://esbuild.github.io/api/#sources-content
23
29
*/
24
- sourcesContent : Boolean ( process . env . NODE_V8_COVERAGE ) ,
30
+ sourcesContent : Boolean ( process . env . NODE_V8_COVERAGE ) || isNodeDebuggerEnabled ,
25
31
26
32
/**
27
33
* Smaller output for cache and marginal performance improvement:
You can’t perform that action at this time.
0 commit comments