New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

loader-count-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loader-count-webpack-plugin

Do you know how many files have been processed by a special webpack loader? Let me tell you!

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Loader-count-webpack-plugin

这是一个 webpage 插件,帮你统计项目中不同的 webpack loader 所处理的文件数目,特别是 node_modules 文件夹中被处理的文件,并在控制台中将结果输出。

Why write this plugin?

在最近的项目中,我遇到了一个奇怪的 bug,引入 pdfjs-dist 模块后,加载 pdf 文件时,始终不发送 Ajax 请求,最后才找到原因,是因为我在项目中引入了 worker-loader 来处理以 .worker.js 结尾的文件,恰好在 pdfjs-dist/build/pdf.js 文件中,引入了 pdf.worker.js 文件,而该文件不需要 worker-loader 来处理,最终导致了 bug 产生。为了以后不在出现类似的 bug,我写了这个插件。

How to use?

const path = require('path')
const LoaderCountPlugin = require('../index')

module.exports = {
  mode: 'production',
  entry: './index.js',
  output: {
    filename: 'bundle.js',
    path: path.join(__dirname, 'dist')
  },
  module: {
    rules: [{
      test: /\.worker\.js$/,
      use: {
        loader: 'worker-loader'
      }
    }]
  },
  plugins: [
    new LoaderCountPlugin()
  ]
}

License

MIT

Keywords

webpack

FAQs

Package last updated on 16 Aug 2018

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