Skip to content

Commit 36a657e

Browse files
bjohansebasclaude
andcommitted
docs(blog): fix the codemod command
The Codemod CLI takes the package directly; 'run' is not part of it. Matches the command the Native CSS guide already documents, which the post now links to for the full option mapping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 4e7528d commit 36a657e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/content/blog/2026-08-29-webpack-5-110.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ It is also faster. Every stylesheet in a loader setup is read, parsed and string
156156

157157
You do not have to do it by hand. There is now a [webpack codemods](https://github.com/webpack/codemods) repository, and its first codemod migrates exactly this:
158158

159-
```sh
160-
npx codemod run @webpack/css-plugins-to-native-css
159+
```bash
160+
npx codemod @webpack/css-plugins-to-native-css
161161
```
162162

163163
It removes the rules that only wire up `style-loader`, `css-loader` and `MiniCssExtractPlugin.loader`, drops the plugin and its import, and moves the options that have a native counterpart: the plugin's `filename` and `chunkFilename` become [`output.cssFilename`](/configuration/output/#outputcssfilename) and [`output.cssChunkFilename`](/configuration/output/#outputcsschunkfilename), `css-loader`'s `modules` sub-options become the rule's `generator` and `parser` options, and a preprocessor left in the chain keeps working with `type: "css/auto"` added to its rule.
164164

165-
It understands the shapes real configs come in, including the `isDev ? "style-loader" : MiniCssExtractPlugin.loader` ternary that ejected Create React App configs use, function-form configs and `webpack-merge` fragments. Anything without a native equivalent is dropped with a comment naming what went, so you can review the change rather than discover it later.
165+
It understands the shapes real configs come in, including the `isDev ? "style-loader" : MiniCssExtractPlugin.loader` ternary that ejected Create React App configs use, function-form configs and `webpack-merge` fragments. Anything without a native equivalent is dropped with a comment naming what went, so you can review the change rather than discover it later. The [Native CSS](/guides/native-css/#migration-guide) guide carries the whole mapping, option by option, for whatever it leaves you.
166166

167167
Underneath, in most projects migrating is deleting configuration:
168168

0 commit comments

Comments
 (0)