-
Notifications
You must be signed in to change notification settings - Fork 0
Home
easy, automatic, optimized dll config handler for webpack
pass in any existing webpack config, get it decorated with dll-reference-plugin and (only when needed) a whole dll-plugin-only!
yarn add d-l-l --dev
npm i d-l-l --save-dev
Using Webpack DLL Plugins can have a drastic build time boost. It allows creating separate bundles for files & dependencies that do not change often.
Unfortunately, it comes with some problems. Thankfully, this package aims to provide solutions for them.
- can be a pain to configure
- requires manually adding plugins, and the entry points in your source code alongside the package dependencies
- requires multiple config files
- requires multiple build scripts
- requires manual cache busting when you change code, which makes it difficult to dynamically include code that does not often change
- does not work without even more configuration on nodejs
- no need to have double config files or double build scripts just for dll
- adding files that do not change often
- adding package dependencies with easy filtering
- easy (even one line) setup
- clearing the cache automatically when needed
Webpack allows exporting an array of configs, so when required, a DLL-only config is created using the provided config(s) & prepended to the array of configs.
Cache files are created in a .fliphub
folder (can be safely added to gitignore, similar to .happypack or similar).
This helps to provide some smart-ish checks:
β = (dll config will be prepended)
- when no cache exists, β
- when there are no manifest files, β
- when cache-busting-files change, the cache is busted and β
- every X (default 10) builds β
- after a day since the last build β
// webpack.config.js
const DLL = require('d-l-l')
const dll = new DLL()
const configs = dll
.dir(__dirname)
.config(config)
.find()
.pkgDeps()
.toConfig()
module.exports = configs