Skip to content

jarneson/webpack-cache-module-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

webpack-cache-module-plugin

Experimental plugin to support longer term caching. At the moment manually stores built module details for a later run. During that later run it sees a normal module has an entry in the cache, if so it returns a CachedModule skipping work like parsing the content to determine dependencies.

This version also caches resolved file paths. These file path resolutions are the far larger time saver than the modules, parsing them, etc.

TODO

  • add plugin hooks to support different modules, sources, dependencies, etc
  • add default hook implementations for webpack built in modules, sources, deps, etc

Testing

Being too experimental at this point, this doesn't have a test suite. But in the test folder will be some helpers in the meantime to generate projects of different sizes to test the cache ability.

cd test
# generate a set of 10 folders containing 10 folders containing 10 scripts
node helpers/make-a-tree.js simple 10 10 10
# bundle it up, this will produce a cache.json used by the next run
node ../node_modules/.bin/webpack
node dist/bundle.js
# 813001.71875

# webpack again, and see how fast it is!
node ../node_modules/.bin/webpack
# the bundle will have the same result
node dist/bundle.js
# 813001.71875

# modify a file and see that its mentioned when building again but not the
# other files

test/helpers/make-a-tree.js

Generates a folder structure to test with caching.

# Generate a project whose resulting bundle returns a number depending on the
# number of folders
node helpers/make-a-tree.js simple n..

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%