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: README.md
+15-9
Original file line number
Diff line number
Diff line change
@@ -71,19 +71,21 @@ module.exports = {
71
71
};
72
72
```
73
73
74
+
> ⚠️ Note that if you import CSS from your webpack entrypoint or import styles in the [initial](https://webpack.js.org/concepts/under-the-hood/#chunks) chunk, `mini-css-extract-plugin` will not load this CSS into the page. Please use [`html-webpack-plugin`](https://github.com/jantimon/html-webpack-plugin) for automatic generation `link` tags or create `index.html` file with `link` tag.
|**[`filename`](#filename)**|`{String\|Function}`|`[name].css`| This option determines the name of each output CSS file |
81
-
|**[`chunkFilename`](#chunkFilename)**|`{String\|Function}`|`based on filename`| This option determines the name of non-entry chunk files |
82
-
|**[`ignoreOrder`](#ignoreOrder)**|`{Boolean}`|`false`| Remove Order Warnings |
83
-
|**[`insert`](#insert)**|`{String\|Function}`|`document.head.appendChild(linkTag);`| Inserts `<link>`at the given position |
84
-
|**[`attributes`](#attributes)**|`{Object}`|`{}`| Adds custom attributes to tag |
85
-
|**[`linkType`](#linkType)**|`{String\|Boolean}`|`text/css`| Allows loading asynchronous chunks with a custom link type |
86
-
|**[`experimentalUseImportModule`](#experimentalUseImportModule)**|`{Boolean}`|`false`| Use an experimental webpack API to execute modules instead of child compilers |
|**[`filename`](#filename)**|`{String\|Function}`|`[name].css`| This option determines the name of each output CSS file |
83
+
|**[`chunkFilename`](#chunkFilename)**|`{String\|Function}`|`based on filename`| This option determines the name of non-entry chunk files |
84
+
|**[`ignoreOrder`](#ignoreOrder)**|`{Boolean}`|`false`| Remove Order Warnings |
85
+
|**[`insert`](#insert)**|`{String\|Function}`|`document.head.appendChild(linkTag);`| Inserts the `link` tag at the given position for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks|
86
+
|**[`attributes`](#attributes)**|`{Object}`|`{}`| Adds custom attributes to the `link` tag for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks|
87
+
|**[`linkType`](#linkType)**|`{String\|Boolean}`|`text/css`| Allows loading asynchronous chunks with a custom link type |
88
+
|**[`experimentalUseImportModule`](#experimentalUseImportModule)**|`{Boolean}`|`false`| Use an experimental webpack API to execute modules instead of child compilers |
87
89
88
90
#### `filename`
89
91
@@ -118,6 +120,8 @@ See [examples](#remove-order-warnings) below for details.
118
120
Type: `String|Function`
119
121
Default: `document.head.appendChild(linkTag);`
120
122
123
+
> ⚠️ Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
124
+
121
125
By default, the `mini-css-extract-plugin` appends styles (`<link>` elements) to `document.head` of the current `window`.
122
126
123
127
However in some circumstances it might be necessary to have finer control over the append target or even delay `link` elements insertion.
@@ -169,6 +173,8 @@ A new `<link>` element will be inserted before the element with id `some-element
169
173
Type: `Object`
170
174
Default: `{}`
171
175
176
+
> ⚠️ Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
177
+
172
178
If defined, the `mini-css-extract-plugin` will attach given attributes with their values on `<link>` element.
"description": "Inserts `<link>` at the given position.",
41
+
"description": "Inserts the `link` tag at the given position for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
"description": "Adds custom attributes to the `link` tag for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
0 commit comments