webpack-cliWebpack's Command Line Interface

联合创作 · 2023-09-30 08:49

webpack CLI

The official CLI of webpack


npm codecov Install Size Chat on gitter

Table of Contents

About

webpack CLI provides the interface of options webpack uses in its configuration file. The CLI options override options passed in the configuration file.

The CLI provides a rich set of commands that helps you develop your application faster.

How to install

When you have followed the Getting Started guide of webpack then webpack CLI is already installed!

Otherwise npm install --save-dev webpack-cli or yarn add webpack-cli --dev will install it.

Supported arguments and commands

Get to know what are the available commands and arguments here.

Packages

We organize webpack CLI as a multi-package repository using lerna. The main CLI logic resides in packages/webpack-cli, while commands supported by the CLI, has dedicated subfolders in the folder packages. A summary of supported commands is described below.

Commands

Supporting developers is an important task for webpack CLI. Thus, webpack CLI provides different commands for many common tasks.

Utilities

The project has several utility packages which are used by other commands

  • generators - Contains all webpack-cli related yeoman generators.

Getting started

When you have followed the Getting Started guide of webpack, then webpack CLI is already installed!

Otherwise, you would need to install webpack CLI and the packages you want to use. If you want to use the init command to create a new configuration file:

npm i webpack-cli @webpack-cli/init
npx webpack-cli init

You will be prompted for some questions about which features you want to use, such as scss, PWA support or multiple entry-points.

Exit codes and their meanings

Exit Code Description
0 Success
1 Errors from webpack
2 Configuration/options problem or an internal error

Contributing and Internal Documentation

The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our contribution documentation.

Open Collective

If you like webpack, please consider donating to our Open Collective to help us maintain it.

Code of Conduct

Guidelines to how the webpack organization expects you to behave is documented under Code of Conduct

浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报