Skip to content

Commit 6b9a4c4

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

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const { Readable, Duplex } = require("stream");
2626
* @property {boolean} [hidePrompt]
2727
* @property {boolean} [waitForExit=true]
2828
*/
29-
function exec(cmd, args, options = {}) {
29+
async function exec(cmd, args, options = {}) {
30+
const chalk = (await import("chalk")).default;
3031
return /**@type {Promise<{exitCode: number}>}*/(new Promise((resolve, reject) => {
3132
const { ignoreExitCode, cancelToken = CancellationToken.none, waitForExit = true } = options;
3233
cancelToken.throwIfCancellationRequested();

0 commit comments

Comments
 (0)