Skip to content

Commit df6994c

Browse files
committed
docs: clarify loader execution order, update example, and improve explanation
1 parent b19136c commit df6994c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/guides/asset-management.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ Loaders in webpack are executed from **right to left** (i.e., from last to first
101101
For example:
102102

103103
```js
104-
use: ["postcss-loader", "sass-loader"];
104+
use: ['postcss-loader', 'sass-loader'],
105105
```
106106

107+
In this rule, `test: /\.css$/i` is a regular expression that tells webpack to apply the rule to `.css` files.
108+
107109
Here, `sass-loader` runs first and compiles Sass into CSS, followed by `postcss-loader`, which applies further transformations.
108110

109111
So even though `postcss-loader` appears before `sass-loader` in the array, the execution happens in reverse order.

0 commit comments

Comments
 (0)