From 109381e842a24e09d124685af22ed0ebffc39398 Mon Sep 17 00:00:00 2001 From: Uzair Date: Fri, 4 Oct 2024 21:58:18 +0530 Subject: [PATCH 1/3] doc: update cli documentation for `create-webpack-app` --- src/content/api/cli.mdx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/content/api/cli.mdx b/src/content/api/cli.mdx index e91305ce9db8..b4bec0262f24 100644 --- a/src/content/api/cli.mdx +++ b/src/content/api/cli.mdx @@ -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 @@ -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 @@ -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 @@ -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. From 74d92349c54592d3066bb8ddc16a7e7dafb87d3a Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Thu, 19 Dec 2024 04:13:22 +0300 Subject: [PATCH 2/3] docs: fix commands --- src/content/api/cli.mdx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/content/api/cli.mdx b/src/content/api/cli.mdx index b4bec0262f24..7805eef7c583 100644 --- a/src/content/api/cli.mdx +++ b/src/content/api/cli.mdx @@ -47,10 +47,7 @@ webpack-cli offers a variety of commands to make working with webpack easier. By | [`build`](#build) | `build\|bundle\|b [entries...] [options]` | Run webpack (default command, can be omitted). | | [`configtest`](#configtest) | `configtest\|t [config-path]` | Validate a webpack configuration. | | [`help`](#help) | `help\|h [command] [option]` | Display help for commands and options. | -| [`info`](#info) | `info\|i [options]` | Outputs information about your system. | -| [`init`](#init) | `init\|create\|c\|new\|n [generation-path] [options]` | Initialize a new webpack project. | -| [`loader`](#loader) | `loader\|l [output-path] [options]` | Scaffold a loader. | -| [`plugin`](#plugin) | `plugin\|p [output-path] [options]` | Scaffold a plugin. | +| [`info`](#info) | `info\|i [options]` | Outputs information about your system. | | [`serve`](#serve) | `serve\|server\|s [options]` | Run the `webpack-dev-server`. | | [`version`](#version) | `version\|v [commands...]` | Output the version number of `webpack`, `webpack-cli` and `webpack-dev-server`. | | [`watch`](#watch) | `watch\|w [entries...] [options]` | Run webpack and watch for files changes. | From 1bdf021383d213645a0a8e04286aa268b953918e Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Thu, 19 Dec 2024 20:22:21 +0300 Subject: [PATCH 3/3] docs: fix name --- src/content/api/cli.mdx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/content/api/cli.mdx b/src/content/api/cli.mdx index 7805eef7c583..7063b06930bf 100644 --- a/src/content/api/cli.mdx +++ b/src/content/api/cli.mdx @@ -68,16 +68,22 @@ npx webpack build --config ./webpack.config.js --stats verbose ### Init -Used to initialize a new webpack project using `@webpack-cli/create-webpack-app`. +Used to initialize a new webpack project using `create-new-webpack-app`. ```bash -npx create-webpack-app init [generation-path] [options] +npx create-new-webpack-app [generation-path] [options] ``` **example** ```bash -npx create-webpack-app init ./my-app --force --template=default +npx create-new-webpack-app ./my-app --force --template=default +``` + +Alias to: + +```bash +npx create-new-webpack-app init ./my-app --force --template=default ``` #### Generation Path @@ -110,13 +116,13 @@ To generate a project without questions. When enabled, the default answer for ea Scaffold a loader. ```bash -npx create-webpack-app loader [output-path] [options] +npx create-new-webpack-app loader [output-path] [options] ``` **example** ```bash -npx create-webpack-app loader ./my-loader --template=default +npx create-new-webpack-app loader ./my-loader --template=default ``` #### Output Path @@ -136,13 +142,13 @@ Type of template. Scaffold a plugin. ```bash -npx create-webpack-app plugin [output-path] [options] +npx create-new-webpack-app plugin [output-path] [options] ``` **example** ```bash -npx create-webpack-app plugin ./my-plugin --template=default +npx create-new-webpack-app plugin ./my-plugin --template=default ``` #### Output Path @@ -157,7 +163,7 @@ 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). +T> See the [full documentation of `create-new-webpack-app`](https://github.com/webpack/webpack-cli/blob/master/packages/create-webpack-app/README.md). ### Info