Skip to content

Commit 1237b6f

Browse files
authored
docs: move from webpack init to create-webpack-app (#7603)
1 parent 1ff902c commit 1237b6f

File tree

1 file changed

+16
-27
lines changed

1 file changed

+16
-27
lines changed

Diff for: src/content/configuration/index.mdx

+16-27
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,33 @@ If for some reason you want to use a different configuration file depending on c
4646

4747
W> webpack applies configuration defaults after [plugins defaults](/contribute/writing-a-plugin/#configuration-defaults) are applied.
4848

49-
Webpack has a huge set of options which might be overwhelming to you, please take advantage of [webpack-cli's `init` command](/api/cli/#init) which could rapidly generate webpack configuration files for your project requirements, it will ask you a couple of questions before creating a configuration file.
49+
Webpack has a huge set of options which might be overwhelming to you, please take advantage of `webpack-cli` starting from version v6.0.0 new tool [create-new-webpack-app](https://github.com/webpack/webpack-cli/) which could rapidly generate webpack application with specific configuration files for your project requirements, it will ask you a couple of questions before creating a configuration file.
5050

5151
```bash
52-
npx webpack init
52+
npx create-new-webpack-app [command] [options]
5353
```
5454

55-
npx might prompt you to install `@webpack-cli/generators` if it is not yet installed in the project or globally. You might also get additional packages installed to your project depending on the choices you've made during the configuration generation.
55+
npx might prompt you to install `create-new-webpack-app` if it is not yet installed in the project or globally. You might also get additional packages installed to your project depending on the choices you've made during the new webpack application generation.
5656

5757
```bash
58-
$ npx webpack init
58+
$ npx create-new-webpack-app init
5959

60-
[webpack-cli] For using this command you need to install: '@webpack-cli/generators' package.
61-
[webpack-cli] Would you like to install '@webpack-cli/generators' package? (That will run 'npm install -D @webpack-cli/generators') (Y/n)
62-
devDependencies:
63-
+ @webpack-cli/generators 2.5.0
64-
? Which of the following JS solutions do you want to use? ES6
60+
Need to install the following packages:
61+
create-new-webpack-[email protected]
62+
Ok to proceed? (y)
63+
64+
? Which of the following JS solutions do you want to use? Typescript
6565
? Do you want to use webpack-dev-server? Yes
6666
? Do you want to simplify the creation of HTML files for your bundle? Yes
6767
? Do you want to add PWA support? No
6868
? Which of the following CSS solutions do you want to use? CSS only
6969
? Will you be using PostCSS in your project? Yes
7070
? Do you want to extract CSS for every file? Only for Production
71-
? Do you like to install prettier to format generated configuration? Yes
72-
? Pick a package manager: pnpm
73-
[webpack-cli] ℹ INFO Initialising project...
74-
75-
devDependencies:
76-
+ @babel/core 7.19.3
77-
+ @babel/preset-env 7.19.4
78-
+ autoprefixer 10.4.12
79-
+ babel-loader 8.2.5
80-
+ css-loader 6.7.1
81-
+ html-webpack-plugin 5.5.0
82-
+ mini-css-extract-plugin 2.6.1
83-
+ postcss 8.4.17
84-
+ postcss-loader 7.0.1
85-
+ prettier 2.7.1
86-
+ style-loader 3.3.1
87-
+ webpack-dev-server 4.11.1
88-
[webpack-cli] Project has been initialised with webpack!
71+
? Which package manager do you want to use? npm
72+
[create-webpack] ℹ️ Initializing a new Webpack project
73+
...
74+
...
75+
...
76+
[create-webpack] ✅ Project dependencies installed successfully!
77+
[create-webpack] ✅ Project has been initialised with webpack!
8978
```

0 commit comments

Comments
 (0)