Socket
Socket
Sign inDemoInstall

statistics-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statistics-webpack-plugin

statistics project


Version published
Weekly downloads
243
increased by7.52%
Maintainers
1
Weekly downloads
 
Created
Source

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. 组件使用统计只在开发环境下生效

Keywords

FAQs

Package last updated on 04 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc