1. Babel loader enables caching
Description in official documents: https://webpack.docschina.org…
Cachedirectory: the default value is false. When there are settings, the specified directory will be used to cache the execution results of the loader. After the webpack build, it will try to read the cache to avoid the Babel recompilation process which may cause high performance consumption during each execution. If you set a null value (loader: ‘Babel loader? Cachedirectory’) or true (loader: ‘Babel loader? Cachedirectory = true’), the loader will use the default cache directory node_ Modules /. Cache / Babel loader, if no node is found in any root directory_ The modules directory will be demoted back to the default temporary file directory of the operating system.
After the cache is enabled, the_ Under modules, you can see a. Cache file
It is found that the way mentioned on the official website does not take effect. It needs to be modified to be written in option
2. Terser webpack plugin enables caching
Parallel is the use of multi process parallel running, which can improve the construction speed and significantly improve the construction speed
Cache enables file caching. Default path of cache directory: node_ modules/.cache/terser-webpack-plugin。
This configuration is the same as webplugin.
3.hard-source-webpack-plugin
Node is used to provide intermediate cache step for module_ Under modules /. Cache / hard source, it can significantly improve the speed of construction!!