1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
Description: Fix TypeScript compilation errors with Debian's tsc version
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2026-03-29
--- a/webpack-cli/packages/webpack-cli/src/webpack-cli.ts
+++ b/webpack-cli/packages/webpack-cli/src/webpack-cli.ts
@@ -344,7 +344,7 @@
}
async getDefaultPackageManager(): Promise<PackageManager | undefined> {
- const { sync } = await import("cross-spawn");
+ const { spawnSync: sync } = await import("child_process");
try {
await fs.promises.access(path.resolve(process.cwd(), "package-lock.json"), fs.constants.F_OK);
@@ -531,10 +531,10 @@
}
if (needInstall) {
- const { sync } = await import("cross-spawn");
+ const { spawnSync: sync } = await import("child_process");
try {
- sync(packageManager, commandArguments, { stdio: "inherit" });
+ sync(packageManager as string, commandArguments, { stdio: "inherit" });
} catch (error) {
this.logger.error(error);
@@ -1622,7 +1622,6 @@
const webpack = await this.loadWebpack();
const webpackOptions = this.schemaToOptions(webpack, undefined, this.#CLIOptions);
const devServer = await this.loadWebpackDevServer();
- // @ts-expect-error different versions of the `Schema` type
const devServerOptions = this.schemaToOptions(webpack, devServer.schema, undefined, {
hidden: false,
negativeHidden: false,
@@ -1950,7 +1949,7 @@
try {
command = new LoadedCommand();
- externalCommand = await command.apply(this);
+ externalCommand = (await command.apply(this)) as any;
} catch (error) {
this.logger.error(`Unable to load '${pkg}' command`);
this.logger.error(error);
@@ -2269,7 +2268,7 @@
// `Promise` may return `Function`
if (this.isFunction(optionsArray[i])) {
// when config is a function, pass the env from args to the config function
- optionsArray[i] = await optionsArray[i](argv.env, argv);
+ optionsArray[i] = await (optionsArray[i] as any)(argv.env, argv);
}
}),
);
|