Skip to content

Commit a211892

Browse files
authored
Update README.md
1 parent 52efd8e commit a211892

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

README.md

+45-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# html-inline-css-webpack-plugin
1+
# html-inline-css-webpack-plugin
2+
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
3+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Runjuu/html-inline-css-webpack-plugin/pulls)
4+
[![npm version](https://badge.fury.io/js/html-inline-css-webpack-plugin.svg)](https://badge.fury.io/js/html-inline-css-webpack-plugin)
5+
6+
Convert `<link rel="stylesheet"/>` into `<style>...<style/>`
7+
8+
## Install
9+
#### NPM
10+
```bash
11+
npm install html-inline-css-webpack-plugin -D
12+
```
13+
#### Yarn
14+
```bash
15+
yarn add html-inline-css-webpack-plugin -D
16+
```
17+
18+
## Minimal example
19+
```js
20+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
21+
const HtmlWebpackPlugin = require('html-webpack-plugin');
22+
const HTMLInlineCSSWebpackPlugin = require("html-inline-css-webpack-plugin").default;
23+
24+
module.exports = {
25+
plugins: [
26+
new MiniCssExtractPlugin({
27+
filename: "[name].css",
28+
chunkFilename: "[id].css"
29+
}),
30+
new HtmlWebpackPlugin(),
31+
new HTMLInlineCSSWebpackPlugin(),
32+
],
33+
module: {
34+
rules: [
35+
{
36+
test: /\.css$/,
37+
use: [
38+
MiniCssExtractPlugin.loader,
39+
"css-loader"
40+
]
41+
}
42+
]
43+
}
44+
}
45+
```

0 commit comments

Comments
 (0)