2.0.5 • Published 5 months ago

statistics-webpack-plugin v2.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

statistics-webpack-plugin

statistic project

目前仅支持.vue和.js文件统计

支持vue2和vue3项目

npm install

npm install statistics-webpack-plugin --save-dev

Usage

默认统计element-ui组件使用情况

const StatisticsWebpackPlugin = require('statistics-webpack-plugin');

module.exports = {
  plugins: [
    new StatisticsWebpackPlugin()
  ]
}

统计其他UI组件,统计ant-design组件

const StatisticsWebpackPlugin = require('statistics-webpack-plugin');

module.exports = {
  plugins: [
    new StatisticsWebpackPlugin({
      regex: /<(ant-[a-z\-]+)/g, // Ant Design
    })
  ]
}

可同时统计多个UI组件

const StatisticsWebpackPlugin = require('statistics-webpack-plugin');

module.exports = {
  plugins: [
    new StatisticsWebpackPlugin({
      regex: /<(ant-[a-z\-]+)/g, // Ant Design
    }),
    new StatisticsWebpackPlugin({
      regex: /<(van-[a-z\-]+)/g, // Vant UI
    })
  ]
}

参数

参数说明类型默认值
regex正则表达式,用于匹配需要统计的组件RegExp/<(el-a-z-+)/g
fileTypes要统计的文件类型String(vue/all)vue

注意

1. 组件使用统计只在开发环境下生效
2.0.5

5 months ago

2.0.2

5 months ago

2.0.0

5 months ago

1.9.0

5 months ago

1.8.0

5 months ago

1.7.5

5 months ago

1.7.0

5 months ago

1.6.0

5 months ago

1.5.0

5 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.8

5 months ago

1.1.5

5 months ago

1.1.2

5 months ago

1.1.0

5 months ago

1.0.5

5 months ago