Skip to content

snowball1990/webpack-optimize-chunk-traversal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-optimize-chunk-traversal

optimize chunk traversal in webpack v2

About

In projects with a lot of chunks, a long time is spent on RemoveParentModulesPlugin in webpack v2. Because of the long module chain with many chunks having many parents, the built-in RemoveParentModulesPlugin has extra work to do.The solution is to (only in development mode) add a new custom plugin which removes the parents of every module as we don't need this optimization when running the app in development mode.

Reference: slow-webpack-build-time-advanced-module-optimization

Installation

# npm
npm install webpack-optimize-chunk-traversal --save-dev

# yarn
yarn add webpack-optimize-chunk-traversal --save-dev

Usage

// webpack.dev.conf.js

const OptimizeChunkTraversePlugin = require('webpack-optimize-chunk-traversal')
 
module.exports = {
  ...
  plugins: [
    new OptimizeChunkTraversePlugin()
  ]
  ...
}

License

MIT

About

optimize chunk traversal in webpack2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published