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/blog/2026-03-22-webpack-5-106.mdx
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ Explore what's new in this release:
12
12
-[**Plugin Validation with `compiler.hooks.validate`**](#plugin-validation-with-compilerhooksvalidate)
13
13
-[**CSS Modules with Runtime Style Injection**](#css-modules-with-runtime-style-injection)
14
14
-[**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)
15
16
-[**Context Support for VirtualUrlPlugin**](#context-support-for-virtualurlplugin)
16
17
-[**Experimental JavaScript Parsing with `oxc-parser`**](#experimental-javascript-parsing-with-oxc-parser)
17
18
-[**Ecosystem Updates**](#ecosystem-updates)
@@ -140,6 +141,57 @@ This also works with `module.require`:
140
141
const { a, b } =module.require("./module");
141
142
```
142
143
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...
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
+
143
195
## Context Support for VirtualUrlPlugin
144
196
145
197
`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