14
14
<p >desc</p >
15
15
</div >
16
16
17
+ This plugin extract CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS.
18
+
19
+ It builds on top of a new webpack v4 feature (module types) and requires webpack 4 to work.
20
+
21
+ Compared to the extract-text-webpack-plugin:
22
+
23
+ * Async loading
24
+ * No duplicate compilation (performance)
25
+ * Easier to use
26
+ * Specific to CSS
27
+
17
28
<h2 align =" center " >Install</h2 >
18
29
19
30
``` bash
@@ -22,72 +33,41 @@ npm install --save-dev mini-css-extract-plugin
22
33
23
34
<h2 align =" center " >Usage</h2 >
24
35
25
- ### Lorem
26
-
27
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
28
-
29
- <h2 align =" center " >Examples</h2 >
36
+ ### Configuration
30
37
31
38
** webpack.config.js**
32
39
33
40
``` js
34
- // Loader/plugin setup here..
35
- ```
36
-
37
- ** file.ext**
38
-
39
- ``` js
40
- // Source code here...
41
- ```
42
-
43
- ** bundle.js**
44
-
45
- ``` js
46
- require (" mini-css-extract-plugin!./file.EXT" );
47
-
48
- // Bundle code here...
41
+ const MiniCssExtractPlugin = require (" mini-css-extract-plugin" );
42
+ module .exports = {
43
+ plugins: [
44
+ new MiniCssExtractPlugin ({
45
+ filename: " [name].css" ,
46
+ chunkFilename: " [id].css"
47
+ })
48
+ ],
49
+ module: {
50
+ rules: [
51
+ {
52
+ test: / \. css$ / ,
53
+ use: [
54
+ MiniCssExtractPlugin .loader ,
55
+ " css-loader"
56
+ ]
57
+ }
58
+ ]
59
+ }
60
+ }
49
61
```
50
62
51
63
<h2 align =" center " >Maintainers</h2 >
52
64
53
- ``` bash
54
- https://api.github.com/users/MAINTAINER
55
- ```
56
-
57
65
<table >
58
66
<tbody >
59
67
<tr>
60
68
<td align="center">
61
- <a href="https://github.com/">
62
- <img width="150" height="150" src="https://avatars.githubusercontent.com/u/5419992?v=3&s=150">
63
- </br>
64
- Name
65
- </a>
66
- </td>
67
- <td align="center">
68
- <a href="https://github.com/">
69
- <img width="150" height="150" src="https://avatars.githubusercontent.com/u/5419992?v=3&s=150">
70
- </br>
71
- Name
72
- </a>
73
- </td>
74
- <td align="center">
75
- <a href="https://github.com/">
76
- <img width="150" height="150" src="https://avatars.githubusercontent.com/u/5419992?v=3&s=150">
77
- </br>
78
- Name
79
- </a>
80
- </td>
81
- <td align="center">
82
- <a href="https://github.com/">
83
- <img width="150" height="150" src="https://avatars.githubusercontent.com/u/5419992?v=3&s=150">
84
- </br>
85
- Name
86
- </a>
87
- </td>
88
- <td align="center">
89
- <a href="https://github.com/">
90
- <img width="150" height="150" src="https://avatars.githubusercontent.com/u/5419992?v=3&s=150">
69
+ <a href="https://github.com/sokra">
70
+ <img width="150" height="150" src="https://github.com/sokra.png?size=150">
91
71
</br>
92
72
Name
93
73
</a>
0 commit comments