Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 1 addition & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion packages/webpack-cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
"use strict";

const importLocal = require("import-local");
const runCLI = require("../lib/bootstrap");
const WebpackCLI = require("../lib/webpack-cli").default;

const runCLI = async (args) => {
const cli = new WebpackCLI();

try {
await cli.run(args);
} catch (error) {
cli.logger.error(error);
process.exit(2);
}
};

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

process.title = "webpack";

// eslint-disable-next-line unicorn/prefer-top-level-await
runCLI(process.argv);
6 changes: 1 addition & 5 deletions packages/webpack-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
],
"dependencies": {
"@discoveryjs/json-ext": "^0.6.1",
"@webpack-cli/configtest": "^3.0.1",
"@webpack-cli/info": "^3.0.1",
"@webpack-cli/serve": "^3.0.1",
"colorette": "^2.0.14",
"commander": "^12.1.0",
"cross-spawn": "^7.0.6",
"envinfo": "^7.14.0",
Expand All @@ -49,7 +45,7 @@
"@types/envinfo": "^7.8.1"
},
"peerDependencies": {
"webpack": "^5.82.0",
"webpack": "^5.101.0",
"webpack-bundle-analyzer": "^4.0.0 || ^5.0.0",
"webpack-dev-server": "^5.0.0"
},
Expand Down
19 changes: 0 additions & 19 deletions packages/webpack-cli/src/bootstrap.ts

This file was deleted.

7 changes: 1 addition & 6 deletions packages/webpack-cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
import WebpackCLI from "./webpack-cli.js";

export type * from "./types.js";
export type * from "./webpack-cli.js";
export { default } from "./webpack-cli.js";

// TODO remove me in the next major release and use `default` export
module.exports = WebpackCLI;
11 changes: 10 additions & 1 deletion packages/webpack-cli/src/plugins/cli-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { type Compiler } from "webpack";
import { type CLIPluginOptions } from "../types.js";

interface CLIPluginOptions {
isMultiCompiler?: boolean;
configPath?: string[];
helpfulOutput: boolean;
hot?: boolean | "only";
progress?: boolean | "profile";
prefetch?: string;
analyze?: boolean;
}

export default class CLIPlugin {
logger!: ReturnType<Compiler["getInfrastructureLogger"]>;
Expand Down
Loading