Skip to content

Commit dfebd57

Browse files
fix: rspack compatibility more.
1 parent 566aa9e commit dfebd57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ function printStats(stats, context) {
318318
(compiler).compilers;
319319

320320
childStatsOptions.colors =
321+
// rspack compatibility
322+
firstCompiler.webpack.cli &&
321323
typeof firstCompiler.webpack.cli.isColorSupported === "function"
322324
? firstCompiler.webpack.cli.isColorSupported()
323325
: isColorSupported();
@@ -334,6 +336,8 @@ function printStats(stats, context) {
334336
if (typeof statsOptions.colors === "undefined") {
335337
const { compiler } = /** @type {{ compiler: Compiler }} */ (context);
336338
statsOptions.colors =
339+
// rspack compatibility
340+
compiler.webpack.cli &&
337341
typeof compiler.webpack.cli.isColorSupported === "function"
338342
? compiler.webpack.cli.isColorSupported()
339343
: isColorSupported();

0 commit comments

Comments
 (0)