Skip to content

Commit 9a38d5f

Browse files
authored
docs: update note in README.md (webpack-contrib#956)
1 parent 26f711e commit 9a38d5f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ module.exports = {
8282
};
8383
```
8484

85-
> ⚠️ 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.
85+
> **Warning**
86+
>
87+
> 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.
8688
87-
> ⚠️ Source maps works only for `source-map`/`nosources-source-map`/`hidden-nosources-source-map`/`hidden-source-map` values because CSS only supports source maps with the `sourceMappingURL` comment (i.e. `//# sourceMappingURL=style.css.map`). If you need set `devtool` to another value you can enable source maps generation for extracted CSS using [`sourceMap: true`](https://github.com/webpack-contrib/css-loader#sourcemap) for `css-loader`.
89+
> **Warning**
90+
>
91+
> Source maps works only for `source-map`/`nosources-source-map`/`hidden-nosources-source-map`/`hidden-source-map` values because CSS only supports source maps with the `sourceMappingURL` comment (i.e. `//# sourceMappingURL=style.css.map`). If you need set `devtool` to another value you can enable source maps generation for extracted CSS using [`sourceMap: true`](https://github.com/webpack-contrib/css-loader#sourcemap) for `css-loader`.
8892
8993
## Options
9094

@@ -158,7 +162,9 @@ Default: `document.head.appendChild(linkTag);`
158162

159163
Inserts the `link` tag at the given position for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks
160164

161-
> ⚠️ Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
165+
> **Warning**
166+
>
167+
> Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
162168
163169
By default, the `mini-css-extract-plugin` appends styles (`<link>` elements) to `document.head` of the current `window`.
164170

@@ -216,7 +222,9 @@ type attributes = Record<string, string>};
216222

217223
Default: `{}`
218224

219-
> ⚠️ Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
225+
> **Warning**
226+
>
227+
> Only for [non-initial (async)](https://webpack.js.org/concepts/under-the-hood/#chunks) chunks.
220228
221229
If defined, the `mini-css-extract-plugin` will attach given attributes with their values on `<link>` element.
222230

@@ -245,7 +253,9 @@ module.exports = {
245253
};
246254
```
247255

248-
Note: It's only applied to dynamically loaded css chunks, if you want to modify link attributes inside html file, please using [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)
256+
> **Note**
257+
>
258+
> It's only applied to dynamically loaded css chunks, if you want to modify link attributes inside html file, please using [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)
249259
250260
#### `linkType`
251261

@@ -763,7 +773,9 @@ module.exports = {
763773

764774
### Hot Module Reloading (HMR)
765775

766-
Note: HMR is automatically supported in webpack 5. No need to configure it. Skip the following:
776+
> **Note**
777+
>
778+
> HMR is automatically supported in webpack 5. No need to configure it. Skip the following:
767779
768780
The `mini-css-extract-plugin` supports hot reloading of actual css files in development.
769781
Some options are provided to enable HMR of both standard stylesheets and locally scoped CSS or CSS modules.

0 commit comments

Comments
 (0)