File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 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({
1010 loader : 'default' ,
1111} ) ;
1212
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+
1319export const cacheConfig = {
1420 ...baseConfig ,
1521
1622 sourcemap : true ,
1723
1824 /**
1925 * Improve performance by only generating sourcesContent
20- * when V8 coverage is enabled
26+ * when V8 coverage is enabled or Node.js debugger is enabled
2127 *
2228 * https://esbuild.github.io/api/#sources-content
2329 */
24- sourcesContent : Boolean ( process . env . NODE_V8_COVERAGE ) ,
30+ sourcesContent : Boolean ( process . env . NODE_V8_COVERAGE ) || isNodeDebuggerEnabled ,
2531
2632 /**
2733 * Smaller output for cache and marginal performance improvement:
You can’t perform that action at this time.
0 commit comments