Skip to content

wangchuan95/dependency-check-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published