File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,8 @@ yarn run lint
123
123
- [ Table 重封装组件] ( https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/table/README.md )
124
124
- [ ANTD 默认配置项] ( https://github.com/sendya/ant-design-pro-vue/blob/master/src/defaultSettings.js )
125
125
- [ 按需加载/减少打包大小] ( 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 )
127
128
- ANTD PRO 额外组件
128
129
- Trend 趋势标记 [ Trend.md] ( https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/Trend/index.md )
129
130
- AvatarList 用户头像列表 [ AvatarList.md] ( https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/AvatarList/index.md )
Original file line number Diff line number Diff line change
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 的地址,完整显示了支持库依赖
You can’t perform that action at this time.
0 commit comments