dependency-check-plugin

0.0.4 • Public • Published

dependency-check-plugin

A webpack plugin that checks dependencies of your package.json file by stats data.

Installation

npm install --save-dev dependency-check-plugin
yarn add --dev dependency-check-plugin

Usage

// webpack.config.js

const { DependencyCheckPlugin } = require('dependency-check-plugin');

module.exports = {
  plugins: [new DependencyCheckPlugin()],
};

Examples

// main.js

import { merge } from 'lodash-es';
import dayjs from 'dayjs';
// api.js

import axios from 'axios';
// package.json

  "dependencies": {
    "axios": "^0.27.2",
    "dayjs": "^1.11.1",
    "moment": "^2.29.3"
  },
  "devDependencies": {
    "lodash-es": "^4.17.21"
  }
// webpack.config.js

const { DependencyCheckPlugin } = require('dependency-check-plugin');

module.exports = {
  entry: {
    main: './src/main.js',
    api: './src/api.js',
  },
  plugins: [new DependencyCheckPlugin()],
};

output:

Bundled dependencies:
* dayjs      ./src/main.js
* axios      ./src/api.js
* lodash-es  ./src/main.js
Missing dependencies:
* lodash-es
Unused dependencies:
* moment

Options

new DependencyCheckPlugin(options)

  • options (Object|undefined)

    • statsOptions (Object|undefined)

    • statsFile (String|undefined)

    • checkOptions (Object|undefined)

      • moduleFilter (Function|undefined)

      • checkKeys (Array|String|undefined)

      • onDone (Function|undefined)

Package Sidebar

Install

npm i dependency-check-plugin

Weekly Downloads

9

Version

0.0.4

License

MIT

Unpacked Size

9.04 kB

Total Files

5

Last publish

Collaborators

  • wangchuan95