Skip to content

Commit 1335250

Browse files
refactor!: remove outdated API (#4672)
1 parent 7085ca3 commit 1335250

File tree

15 files changed

+491
-857
lines changed

15 files changed

+491
-857
lines changed

package-lock.json

Lines changed: 1 addition & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/webpack-cli/bin/cli.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
"use strict";
44

55
const importLocal = require("import-local");
6-
const runCLI = require("../lib/bootstrap");
6+
const WebpackCLI = require("../lib/webpack-cli").default;
7+
8+
const runCLI = async (args) => {
9+
const cli = new WebpackCLI();
10+
11+
try {
12+
await cli.run(args);
13+
} catch (error) {
14+
cli.logger.error(error);
15+
process.exit(2);
16+
}
17+
};
718

819
if (
920
!process.env.WEBPACK_CLI_SKIP_IMPORT_LOCAL && // Prefer the local installation of `webpack-cli`
@@ -14,4 +25,5 @@ if (
1425

1526
process.title = "webpack";
1627

28+
// eslint-disable-next-line unicorn/prefer-top-level-await
1729
runCLI(process.argv);

packages/webpack-cli/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
],
3333
"dependencies": {
3434
"@discoveryjs/json-ext": "^0.6.1",
35-
"@webpack-cli/configtest": "^3.0.1",
36-
"@webpack-cli/info": "^3.0.1",
37-
"@webpack-cli/serve": "^3.0.1",
38-
"colorette": "^2.0.14",
3935
"commander": "^12.1.0",
4036
"cross-spawn": "^7.0.6",
4137
"envinfo": "^7.14.0",
@@ -49,7 +45,7 @@
4945
"@types/envinfo": "^7.8.1"
5046
},
5147
"peerDependencies": {
52-
"webpack": "^5.82.0",
48+
"webpack": "^5.101.0",
5349
"webpack-bundle-analyzer": "^4.0.0 || ^5.0.0",
5450
"webpack-dev-server": "^5.0.0"
5551
},

packages/webpack-cli/src/bootstrap.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/webpack-cli/src/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
import WebpackCLI from "./webpack-cli.js";
2-
3-
export type * from "./types.js";
1+
export type * from "./webpack-cli.js";
42
export { default } from "./webpack-cli.js";
5-
6-
// TODO remove me in the next major release and use `default` export
7-
module.exports = WebpackCLI;

packages/webpack-cli/src/plugins/cli-plugin.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { type Compiler } from "webpack";
2-
import { type CLIPluginOptions } from "../types.js";
2+
3+
interface CLIPluginOptions {
4+
isMultiCompiler?: boolean;
5+
configPath?: string[];
6+
helpfulOutput: boolean;
7+
hot?: boolean | "only";
8+
progress?: boolean | "profile";
9+
prefetch?: string;
10+
analyze?: boolean;
11+
}
312

413
export default class CLIPlugin {
514
logger!: ReturnType<Compiler["getInfrastructureLogger"]>;

0 commit comments

Comments
 (0)