File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- import { constants } from 'node:os' ;
2- import process from 'node:process' ;
1+ import defer * as os from 'node:os' ;
2+ import defer * as process from 'node:process' ;
33
44type Callback = ( exitCode : number ) => void ;
55
@@ -37,11 +37,11 @@ export function exitHook(onExit: Callback): () => void {
3737 // Use `process.on` instead of `process.once` to disable
3838 // Node.js's default exit behavior
3939 process . on ( 'SIGINT' , ( ) => {
40- exit ( constants . signals . SIGINT + 128 , 'SIGINT' ) ;
40+ exit ( os . constants . signals . SIGINT + 128 , 'SIGINT' ) ;
4141 } ) ;
4242 // `kill` command
4343 process . once ( 'SIGTERM' , ( ) => {
44- exit ( constants . signals . SIGTERM + 128 , 'SIGTERM' ) ;
44+ exit ( os . constants . signals . SIGTERM + 128 , 'SIGTERM' ) ;
4545 } ) ;
4646 // process.exit or others
4747 process . once ( 'exit' , ( exitCode ) => {
Original file line number Diff line number Diff line change 55import fs from 'node:fs' ;
66import path from 'node:path' ;
77import { promisify } from 'node:util' ;
8- import zlib from 'node:zlib' ;
8+ import defer * as zlib from 'node:zlib' ;
99import { JS_REGEX } from '../constants' ;
1010import { color } from '../helpers' ;
1111import { getAssetsFromStats , type RsbuildAsset } from '../helpers/stats' ;
Original file line number Diff line number Diff line change 1- import { constants } from 'node:os' ;
1+ import defer * as os from 'node:os' ;
22
33/**
44 * A set to store all cleanup callbacks that should be executed before process termination
@@ -41,7 +41,7 @@ export const setupGracefulShutdown = (): (() => void) => {
4141 // or manually via 'kill -15 <pid>' or 'kill -TERM <pid>' command.
4242 // Add 128 to signal number as per POSIX convention for signal-terminated processes.
4343 const onSigterm = ( ) => {
44- handleTermination ( constants . signals . SIGTERM + 128 ) ;
44+ handleTermination ( os . constants . signals . SIGTERM + 128 ) ;
4545 } ;
4646 process . once ( 'SIGTERM' , onSigterm ) ;
4747
Original file line number Diff line number Diff line change 11import type { ServerResponse } from 'node:http' ;
2- import zlib from 'node:zlib' ;
2+ import defer * as zlib from 'node:zlib' ;
33import type { CompressOptions , RequestHandler } from '../types' ;
44
55const ENCODING_REGEX = / \b g z i p \b / ;
You can’t perform that action at this time.
0 commit comments