Skip to content

Commit 6b363f0

Browse files
authored
Clarify limitations with mini-css-extract-plugin & initial chunks
1 parent cc64284 commit 6b363f0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ module.exports = {
7171
};
7272
```
7373

74+
### ⚠ CSS is not loaded from initial chunks.
75+
76+
Note that if you import CSS from your webpack entrypoint (in the initial chunk), `mini-css-extract-plugin` will not load this CSS into the page. `html-webpack-plugin` usually loads this CSS for you, but if you're not using that plugin, you'll need to use a dynamic `import()` to force the CSS to be split into a separate chunk. Either of the following would work:
77+
78+
**component.js**
79+
80+
```js
81+
import("./style.css");
82+
```
83+
84+
**app.js**
85+
86+
```js
87+
import("./component");
88+
```
89+
90+
7491
## Options
7592

7693
### Plugin Options

0 commit comments

Comments
 (0)