File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
- # CSS Extraction
1
+ # CSS 提取
2
2
3
- ::: tip
4
- Only apply CSS extraction for production so that you get CSS hot reload during development.
3
+ :::tip 提示
4
+ 只有生产环境才会运用 CSS 提取,这有便于你在开发环境下进行热重载。
5
5
:::
6
6
7
7
## webpack 4
@@ -15,10 +15,10 @@ npm install -D mini-css-extract-plugin
15
15
var MiniCssExtractPlugin = require (' mini-css-extract-plugin' )
16
16
17
17
module .exports = {
18
- // other options ...
18
+ // 其它选项 ...
19
19
module: {
20
20
rules: [
21
- // ...other rules omitted
21
+ // ...其它规则忽略
22
22
{
23
23
test: / \. css$ / ,
24
24
use: [
@@ -31,15 +31,15 @@ module.exports = {
31
31
]
32
32
},
33
33
plugins: [
34
- // ...vue-loader plugin omitted
34
+ // ...vue-loader 插件忽略
35
35
new MiniCssExtractPlugin ({
36
36
filename: style .css
37
37
})
38
38
]
39
39
}
40
40
```
41
41
42
- Also see [ mini-css-extract-plugin docs ] ( https://github.com/webpack-contrib/mini-css-extract-plugin ) .
42
+ 你还可以查阅 [ mini-css-extract-plugin 文档 ] ( https://github.com/webpack-contrib/mini-css-extract-plugin ) 。
43
43
44
44
## webpack 3
45
45
@@ -52,10 +52,10 @@ npm install -D extract-text-webpack-plugin
52
52
var ExtractTextPlugin = require (" extract-text-webpack-plugin" )
53
53
54
54
module .exports = {
55
- // other options ...
55
+ // 其它选项 ...
56
56
module: {
57
57
rules: [
58
- // ...other rules omitted
58
+ // ...其它规则忽略
59
59
{
60
60
test: / \. css$ / ,
61
61
loader: ExtractTextPlugin .extract ({
@@ -66,10 +66,10 @@ module.exports = {
66
66
]
67
67
},
68
68
plugins: [
69
- // ...vue-loader plugin omitted
69
+ // ...vue-loader 插件忽略
70
70
new ExtractTextPlugin (" style.css" )
71
71
]
72
72
}
73
73
```
74
74
75
- Also see [ extract-text-webpack-plugin docs ] ( https://github.com/webpack-contrib/extract-text-webpack-plugin ) .
75
+ 你也可以查阅 [ extract-text-webpack-plugin 文档 ] ( https://github.com/webpack-contrib/extract-text-webpack-plugin ) 。
You can’t perform that action at this time.
0 commit comments