Skip to content

Commit 9e84d89

Browse files
committed
docs(guides): remove css-loader from native CSS migration diff
1 parent 22879b6 commit 9e84d89

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/content/guides/native-css.mdx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Notes:
204204

205205
### 4) Replace `mini-css-extract-plugin`
206206

207-
When `experiments.css` is enabled, webpack provides native CSS extraction and content hash handling for CSS output files.
207+
When `experiments.css` is enabled, webpack provides native CSS extraction and content hash handling for CSS output files, so you can drop both `mini-css-extract-plugin` and `css-loader` from this basic setup.
208208

209209
**webpack.config.js**
210210

@@ -215,22 +215,13 @@ When `experiments.css` is enabled, webpack provides native CSS extraction and co
215215
+ experiments: {
216216
+ css: true,
217217
+ },
218-
module: {
219-
rules: [
220-
{
221-
test: /\.css$/i,
222-
- use: [MiniCssExtractPlugin.loader, "css-loader"],
223-
+ use: ["css-loader"],
224-
},
225-
],
226-
},
227218
- plugins: [new MiniCssExtractPlugin()],
228219
};
229220
```
230221

231222
You can remove:
232223

233-
- `MiniCssExtractPlugin.loader` from `module.rules`,
224+
- the CSS loader chain (including `css-loader`) from `module.rules`,
234225
- the `new MiniCssExtractPlugin()` plugin instance.
235226

236227
### 5) Replace `style-loader` with `exportType: "style"`

0 commit comments

Comments
 (0)