Skip to content

Commit 4967365

Browse files
committed
Import chalk with import() syntax
This makes code compatible with chalk v5.0.0.
1 parent 912c01a commit 4967365

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/browserIntegrationTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @ts-check
2-
const chalk = require("chalk");
32
const { join } = require("path");
43
const { readFileSync } = require("fs");
54
try {
@@ -18,6 +17,7 @@ const playwright = require("playwright");
1817
const debugging = false;
1918

2019
(async () => {
20+
const chalk = (await import("chalk")).default;
2121
for (const browserType of ["chromium", "firefox"]) {
2222
const browser = await playwright[browserType].launch({ headless: !debugging });
2323
const context = await browser.newContext();

scripts/build/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const mkdirp = require("mkdirp");
88
const del = require("del");
99
const File = require("vinyl");
1010
const ts = require("../../lib/typescript");
11-
const chalk = require("chalk");
1211
const which = require("which");
1312
const { spawn } = require("child_process");
1413
const { CancellationToken, CancelError, Deferred } = require("prex");
@@ -26,7 +25,8 @@ const { Readable, Duplex } = require("stream");
2625
* @property {boolean} [hidePrompt]
2726
* @property {boolean} [waitForExit=true]
2827
*/
29-
function exec(cmd, args, options = {}) {
28+
async function exec(cmd, args, options = {}) {
29+
const chalk = (await import("chalk")).default;
3030
return /**@type {Promise<{exitCode: number}>}*/(new Promise((resolve, reject) => {
3131
const { ignoreExitCode, cancelToken = CancellationToken.none, waitForExit = true } = options;
3232
cancelToken.throwIfCancellationRequested();

0 commit comments

Comments
 (0)