本文主要写一些webpack相关
# webpackbar
用于Webpack的优雅进度条
# 安装
npm install webpackbar -D
1
# 在webpack中使用
然后将其作为webpack插件引入到webpack配置中
const webpack = require('webpack');
const WebpackBar = require('webpackbar');
module.exports = {
...
plugins: [
new WebpackBar()
]
...
};
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 在vue.config.js 中配置
const WebpackBar = require('webpackbar');
module.exports = {
...
configureWebpack: {
plugins: [
new WebpackBar()
]
}
...
};
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# options
常用配置项, 填入的为默认值。
具体配置可访问项目github查看webpackbar
{
name: "webpack", //进度条前方显示文字
color: "green", //进度条颜色
profile: false, // 启用探查器
}
1
2
3
4
5
2
3
4
5