New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mokahr/unused-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mokahr/unused-webpack-plugin

A webpack plugin used to find unused source files

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by28.57%
Maintainers
2
Weekly downloads
 
Created
Source

unused-webpack-plugin

A Webpack plugin used to find unused source files

Usage

  1. Install dependency.

npm install --save-dev @mokahr/unused-webpack-plugin

  1. Update webpack config file.
const UnusedWebpackPlugin = require('@mokahr/unused-webpack-plugin');

// your webpack config
module.exports = {
  ...
  plugins: [
    ...
    new UnusedWebpackPlugin(), // use the 'unused' plugin ;-)
  ]
}
  1. Restart your webpack server and a new file named unused-files will be created under the project working directory.

Configuration

new UnusedWebpackPlugin(options)

[optional] options.cwd: string

Current working directory, default value is ./

[optional] options.patterns: string[]

Included glob pattern list, default value is ['**/*.js', '**/*.styl'], which means only .js or .styl files will be checked.

Note: Usually not all the static assets are referenced in js files directly, such as some images or font files, therefore we do not recommend to use the pattern * directly, otherwise you may got some misleading results.

[optional] options.ignores: string[]

Excluded glob pattern list, default value is ['node_modules/**']

[optional] options.output: string

The result file path, default value is ./unused-files

Tips

  • Please do not use this plugin on production environment.
  • After generating unused files, you can remove them by shell command cat unused-files | while read LINE; do rm $LINE; done.

FAQs

Package last updated on 30 Dec 2019

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc