webpack-configurator
webpack-configurator copied to clipboard
Mixin _.set
it would be cool to be able to write:
config.set('entry.main', './foo.js')
_.set
provides this.
Why?
I find that big nested objects are common in webpack configs but are hard to keep track of the nesting level. This would allow a nice un-nested webpack config.
Or rather, allow an override of config.merge('entry.main', ['./foo.js'])
. If first arg is string, generate an object of the string path, then merge.
Set would be useful separately to override things.
I do quite like this idea. I agree that heavily nested configurations aren't nice to deal with. Maybe this kind of thing will help reduce that pain.
My approach in the past has been to split out sections into variables (and sometimes methods) to reduce the immediate nesting.