All Projects → MatthieuLemoine → unused-webpack-plugin

MatthieuLemoine / unused-webpack-plugin

Licence: other
A webpack plugin to find unused modules/source files.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to unused-webpack-plugin

lint-deps
Lint for unused or missing dependencies in your node.js projects. Customize with plugins or configuration.
Stars: ✭ 48 (-68.21%)
Mutual labels:  unused
covid-data-pipeline
Scan/Trim/Extra Pipeline for State Coronavirus Site
Stars: ✭ 15 (-90.07%)
Mutual labels:  unused
deadfile
Simple util to find unused files in any JavaScript project (ES5, ES6, React, Vue, ...)
Stars: ✭ 259 (+71.52%)
Mutual labels:  unused
mix unused
Find unused functions in your project
Stars: ✭ 181 (+19.87%)
Mutual labels:  unused
Dropcss
An exceptionally fast, thorough and tiny unused-CSS cleaner
Stars: ✭ 2,102 (+1292.05%)
Mutual labels:  unused
Lsunusedresources
A Mac App to find unused images and resources in XCode project.
Stars: ✭ 3,692 (+2345.03%)
Mutual labels:  unused
unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 119 (-21.19%)
Mutual labels:  unused
covid-tracking-dash
Dash app for COVID Tracking Project (https://covidtracking.com/)
Stars: ✭ 26 (-82.78%)
Mutual labels:  unused

UnusedWebpackPlugin CircleCI

A webpack plugin to find unused modules/source files.

unused-webpack-plugin

Install

npm i --dev unused-webpack-plugin

Usage

const path = require('path');
const UnusedWebpackPlugin = require('unused-webpack-plugin');

module.exports = {
  // webpack configuration
  plugins: [
    ...otherPlugins,
    new UnusedWebpackPlugin({
      // Source directories
      directories: [path.join(__dirname, 'src')],
      // Exclude patterns
      exclude: ['*.test.js'],
      // Root directory (optional)
      root: __dirname,
    }),
  ],
};

Options

  • directories : array of directories where to look for unused source files.
  • exclude : array of exclude patterns when looking for unused source files.
  • root : root directory that will be use to display relative paths instead of absolute ones (see below)
  • failOnUnused: whether or not the build should fail if unused files are found (defaults to false)
  • useGitIgnore: whether or not to respect .gitignore file (defaults to true)

With root

With root

Without root

Without root

Related

If you're not using webpack, check out remnants.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].