Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update cli documentation for create-webpack-app #7418

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
23 changes: 15 additions & 8 deletions src/content/api/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ npx webpack build --config ./webpack.config.js --stats verbose

### Init

Used to initialize a new webpack project.
Used to initialize a new webpack project using `@webpack-cli/create-webpack-app`.

```bash
npx webpack init [generation-path] [options]
npx create-webpack-app init [generation-path] [options]
```

**example**

```bash
npx webpack init ./my-app --force --template=default
npx create-webpack-app init ./my-app --force --template=default
```

#### Generation Path
Expand All @@ -101,20 +101,25 @@ Name of template to generate.

To generate a project without questions. When enabled, the default answer for each question will be used.

T> See the [full documentation of `webpack init` command](https://github.com/webpack/webpack-cli/blob/master/packages/generators/INIT.md).
#### Templates supported

- `--template=default` - Default template with basic configuration.
- `--template=react` - Template with React configuration.
- `--template=vue` - Template with Vue configuration.
- `--template=svelte` - Template with Svelte configuration.`

### Loader

Scaffold a loader.

```bash
npx webpack loader [output-path] [options]
npx create-webpack-app loader [output-path] [options]
```

**example**

```bash
npx webpack loader ./my-loader --template=default
npx create-webpack-app loader ./my-loader --template=default
```

#### Output Path
Expand All @@ -134,13 +139,13 @@ Type of template.
Scaffold a plugin.

```bash
npx webpack plugin [output-path] [options]
npx create-webpack-app plugin [output-path] [options]
```

**example**

```bash
npx webpack plugin ./my-plugin --template=default
npx create-webpack-app plugin ./my-plugin --template=default
```

#### Output Path
Expand All @@ -155,6 +160,8 @@ Path to the output directory, e.g. `./plugin-name`.

Type of template.

T> See the [full documentation of `create-webpack-app`](https://github.com/webpack/webpack-cli/blob/master/packages/create-webpack-app/README.md).

### Info

Outputs information about your system.
Expand Down