Skip to content

Commit 816be98

Browse files
committed
feat: doc update
1 parent a466895 commit 816be98

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ yarn run lint
123123
- [Table 重封装组件](https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/table/README.md)
124124
- [ANTD 默认配置项](https://github.com/sendya/ant-design-pro-vue/blob/master/src/defaultSettings.js)
125125
- [按需加载/减少打包大小](https://github.com/sendya/ant-design-pro-vue/blob/master/docs/LoadOnDemand.md)
126-
- [为首屏增加 Loading 动画](https://github.com/sendya/ant-design-pro-vue/blob/master/docs/Add-Page-Loading-Animate.md)
126+
- [为首屏增加 Loading 动画](https://github.com/sendya/ant-design-pro-vue/blob/master/docs/Add-Page-Loading-Animate.md)
127+
- [为项目增加依赖项分析工具 analyzer](https://github.com/sendya/ant-design-pro-vue/blob/master/docs/webpack-bundle-analyzer.md)
127128
- ANTD PRO 额外组件
128129
- Trend 趋势标记 [Trend.md](https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/Trend/index.md)
129130
- AvatarList 用户头像列表 [AvatarList.md](https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/AvatarList/index.md)

docs/webpack-bundle-analyzer.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
先增加依赖
2+
3+
```bash
4+
// npm
5+
$ npm install --save-dev webpack-bundle-analyzer
6+
7+
// or yarn
8+
$ yarn add webpack-bundle-analyzer -D
9+
```
10+
11+
配置文件 `vue.config.js` 增加 `configureWebpack.plugins` 参数
12+
13+
```
14+
const path = require('path')
15+
const webpack = require('webpack')
16+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
17+
18+
function resolve (dir) {
19+
return path.join(__dirname, dir)
20+
}
21+
22+
// vue.config.js
23+
module.exports = {
24+
configureWebpack: {
25+
plugins: [
26+
// Ignore all locale files of moment.js
27+
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
28+
// 依赖大小分析工具
29+
new BundleAnalyzerPlugin(),
30+
]
31+
},
32+
33+
34+
...
35+
}
36+
```
37+
38+
39+
40+
启动 `cli``build` 命令进行项目编译,编译完成时,会自动运行一个 http://localhost:8888 的地址,完整显示了支持库依赖

0 commit comments

Comments
 (0)