webpack-chain icon indicating copy to clipboard operation
webpack-chain copied to clipboard

`Config.node` is incorrectly assumed to always be an object

Open opl- opened this issue 5 years ago • 3 comments

webpack-chain makes the incorrect assumption that Config.node can never be anything other than an object, despite webpack allowing it to be set to false.

As a result, calling config.set('node', false) results in the value being lost and the node property not existing in the object generated with Config.toConfig().

opl- avatar Nov 11 '19 08:11 opl-

Hi! Thank you for filing this issue - I agree webpack-chain should support this case. Would you be open to creating a PR for it? :-)

edmorley avatar Jan 28 '20 11:01 edmorley

Hi! Try to fix this, have a little problem, if i want to add config.node(false) shortcut, because need a save backward compatibility, and can't make config.node callable and ChainedMap instance at the same time:

config.node(false) // callable, need to be a function

config.node.set('global', false) // ChainedMap instance

It will be okay if i fix only config.set('node', false) case? But i don't know how user can save boolean value to node property, and them rewrite it to ChainedMap...

SuperOleg39 avatar Mar 30 '20 13:03 SuperOleg39

@edmorley Hello! If you have a time, need PR review)

SuperOleg39 avatar Apr 23 '20 08:04 SuperOleg39