Skip to content

Commit aeb81dd

Browse files
committed
blog: add Getting Started section for create-webpack-app to guide new users
1 parent f27f038 commit aeb81dd

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/content/blog/2026-03-22-webpack-5-106.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Explore what's new in this release:
1212
- [**Plugin Validation with `compiler.hooks.validate`**](#plugin-validation-with-compilerhooksvalidate)
1313
- [**CSS Modules with Runtime Style Injection**](#css-modules-with-runtime-style-injection)
1414
- [**Better Tree Shaking for CommonJS Destructuring**](#better-tree-shaking-for-commonjs-destructuring)
15+
- [**Getting Started with `create-webpack-app`**](#getting-started-with-create-webpack-app)
1516
- [**Context Support for VirtualUrlPlugin**](#context-support-for-virtualurlplugin)
1617
- [**Experimental JavaScript Parsing with `oxc-parser`**](#experimental-javascript-parsing-with-oxc-parser)
1718
- [**Ecosystem Updates**](#ecosystem-updates)
@@ -140,6 +141,57 @@ This also works with `module.require`:
140141
const { a, b } = module.require("./module");
141142
```
142143

144+
## Getting Started with `create-webpack-app`
145+
146+
[`create-webpack-app`](https://www.npmjs.com/package/create-webpack-app) is now the recommended way to scaffold a new webpack project. Previously, this functionality lived inside `webpack-cli` as the `webpack init` command, but it has been extracted into its own standalone package with the release of webpack-cli 7.
147+
148+
This means you can now create a new webpack project with a single command, without needing to install `webpack-cli` first:
149+
150+
```bash
151+
npx create-webpack-app
152+
```
153+
154+
The CLI walks you through an interactive setup where you choose the pieces that fit your project:
155+
156+
```bash
157+
$ npx create-webpack-app
158+
159+
? Which of the following JS solutions do you want to use? Typescript
160+
? Do you want to use webpack-dev-server? Yes
161+
? Do you want to simplify the creation of HTML files for your bundle? Yes
162+
? Do you want to add PWA support? No
163+
? Which of the following CSS solutions do you want to use? CSS only
164+
? Will you be using PostCSS in your project? Yes
165+
? Do you want to extract CSS for every file? Only for Production
166+
? Which package manager do you want to use? npm
167+
168+
[create-webpack] ℹ️ Initializing a new Webpack project...
169+
[create-webpack] ✅ Project dependencies installed successfully!
170+
```
171+
172+
The generated project includes a working `webpack.config.js`, dev server configuration, and the loader/plugin setup for the options you selected. From there, you can start developing immediately:
173+
174+
```bash
175+
cd my-project
176+
npm start
177+
```
178+
179+
This approach follows the same pattern popularized by tools like `create-react-app` and `create-vite`: a single `npx` command that gets you from zero to a working project without manual configuration.
180+
181+
You can also use the `init` subcommand if you prefer the explicit form:
182+
183+
```bash
184+
npx create-webpack-app init
185+
```
186+
187+
Beyond project scaffolding, `create-webpack-app` can also generate the boilerplate for custom loaders and plugins:
188+
189+
```bash
190+
npx create-webpack-app loader
191+
192+
npx create-webpack-app plugin
193+
```
194+
143195
## Context Support for VirtualUrlPlugin
144196

145197
`VirtualUrlPlugin` (via `webpack.experiments.schemes.VirtualUrlPlugin`) now supports a `context` option that defines the **base directory used to resolve relative imports inside virtual modules**. This feature is currently **experimental**, as it is part of the `experiments.schemes` API.

0 commit comments

Comments
 (0)