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 提取
22
3- ::: tip
4- Only apply CSS extraction for production so that you get CSS hot reload during development.
3+ :::tip 提示
4+ 只有生产环境才会运用 CSS 提取,这有便于你在开发环境下进行热重载。
55:::
66
77## webpack 4
@@ -15,10 +15,10 @@ npm install -D mini-css-extract-plugin
1515var MiniCssExtractPlugin = require (' mini-css-extract-plugin' )
1616
1717module .exports = {
18- // other options ...
18+ // 其它选项 ...
1919 module: {
2020 rules: [
21- // ...other rules omitted
21+ // ...其它规则忽略
2222 {
2323 test: / \. css$ / ,
2424 use: [
@@ -31,15 +31,15 @@ module.exports = {
3131 ]
3232 },
3333 plugins: [
34- // ...vue-loader plugin omitted
34+ // ...vue-loader 插件忽略
3535 new MiniCssExtractPlugin ({
3636 filename: style .css
3737 })
3838 ]
3939}
4040```
4141
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 ) 。
4343
4444## webpack 3
4545
@@ -52,10 +52,10 @@ npm install -D extract-text-webpack-plugin
5252var ExtractTextPlugin = require (" extract-text-webpack-plugin" )
5353
5454module .exports = {
55- // other options ...
55+ // 其它选项 ...
5656 module: {
5757 rules: [
58- // ...other rules omitted
58+ // ...其它规则忽略
5959 {
6060 test: / \. css$ / ,
6161 loader: ExtractTextPlugin .extract ({
@@ -66,10 +66,10 @@ module.exports = {
6666 ]
6767 },
6868 plugins: [
69- // ...vue-loader plugin omitted
69+ // ...vue-loader 插件忽略
7070 new ExtractTextPlugin (" style.css" )
7171 ]
7272}
7373```
7474
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