You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/configuration/index.mdx
+16-27Lines changed: 16 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -46,44 +46,33 @@ If for some reason you want to use a different configuration file depending on c
46
46
47
47
W> webpack applies configuration defaults after [plugins defaults](/contribute/writing-a-plugin/#configuration-defaults) are applied.
48
48
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.
50
50
51
51
```bash
52
-
npx webpack init
52
+
npx create-new-webpack-app [command] [options]
53
53
```
54
54
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.
56
56
57
57
```bash
58
-
$ npx webpack init
58
+
$ npx create-new-webpack-app init
59
59
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-app@1.1.1
62
+
Ok to proceed? (y)
63
+
64
+
? Which of the following JS solutions do you want to use?Typescript
65
65
? Do you want to use webpack-dev-server? Yes
66
66
? Do you want to simplify the creation of HTML files for your bundle? Yes
67
67
? Do you want to add PWA support? No
68
68
? Which of the following CSS solutions do you want to use? CSS only
69
69
? Will you be using PostCSS in your project? Yes
70
70
? 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
0 commit comments