Skip to content

A webpack plugin to remove obsolete chunk files in webpack watch mode

License

Notifications You must be signed in to change notification settings

Noldaru/webpack-clean-obsolete-chunks

 
 

Repository files navigation

webpack-clean-obsolete-chunks

npm version Coverage Status Build Status dependencies devDependencies Code Climate

A webpack plugin to remove obsolete chunk files in webpack watch mode. Especially useful when use hashes in output file names.

Installation

Via yarn:

yarn add webpack-clean-obsolete-chunks --dev

or via npm:

npm install webpack-clean-obsolete-chunks --save-dev

Usage

Just add this plugin as usual.

// webpack.config.js
var CleanObsoleteChunks = require('webpack-clean-obsolete-chunks');

module.exports = {
    // ...
    plugins: [
        new CleanObsoleteChunks(options)
    ]
    // ...
};

Options

{
  // Write logs to console.
  // Default: true
  verbose: true,

  // Clean obsolete chunks of webpack child compilations.
  // Default: false
  deep: true
}

NOTE: {deep: true} option will work only if all descendent compilations of the initial compilation have unique names

How it works

Plugin searches for all updated chunks and deletes obsolete files in output directory after each webpack compilation.

Support

We currently support Node.js of version ^6, ^7, ^8 and Webpack of version ^2, ^3 (but ^1 should work also).

Contribution

You're free to contribute to this project by submitting issues and/or pull requests. Please be sure to read the contribution guidelines before making changes for a pull request.

License

This project is licensed under MIT.

About

A webpack plugin to remove obsolete chunk files in webpack watch mode

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.9%
  • CSS 0.1%