Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/cli-performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-cli": patch
---

Improved CLI startup performance and reduced memory usage.
19 changes: 9 additions & 10 deletions packages/webpack-cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

"use strict";

const importLocal = require("import-local");
// Prefer the local installation of `webpack-cli` when one exists. Run this
// before requiring the (heavier) CLI implementation: a delegated run then never
// loads it, and `WEBPACK_CLI_SKIP_IMPORT_LOCAL` skips loading `import-local` too.
if (!process.env.WEBPACK_CLI_SKIP_IMPORT_LOCAL && require("import-local")(__filename)) {
return;
}

process.title = "webpack";

const WebpackCLI = require("../lib/webpack-cli").default;

const runCLI = async (args) => {
Expand All @@ -16,14 +24,5 @@ const runCLI = async (args) => {
}
};

if (
!process.env.WEBPACK_CLI_SKIP_IMPORT_LOCAL && // Prefer the local installation of `webpack-cli`
importLocal(__filename)
) {
return;
}

process.title = "webpack";

// eslint-disable-next-line unicorn/prefer-top-level-await
runCLI(process.argv);
165 changes: 0 additions & 165 deletions packages/webpack-cli/src/levenshtein.ts

This file was deleted.

Loading
Loading