Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Config.node is incorrectly assumed to always be an object #209

Closed
opl- opened this issue Nov 11, 2019 · 3 comments
Closed

Config.node is incorrectly assumed to always be an object #209

opl- opened this issue Nov 11, 2019 · 3 comments

Comments

@opl-
Copy link
Contributor

opl- commented Nov 11, 2019

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().

@edmorley edmorley added the bug label Dec 13, 2019
@edmorley
Copy link
Member

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? :-)

@SuperOleg39
Copy link

SuperOleg39 commented Mar 30, 2020

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 pushed a commit to SuperOleg39/webpack-chain that referenced this issue Mar 30, 2020
SuperOleg39 pushed a commit to SuperOleg39/webpack-chain that referenced this issue Mar 30, 2020
SuperOleg39 pushed a commit to SuperOleg39/webpack-chain that referenced this issue Mar 30, 2020
@SuperOleg39
Copy link

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

@edmorley edmorley closed this as completed Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

3 participants