Currently, when the component.json of a component is written and the env is set to a local one, it gets removed upon bit import unexpectedly.
After a long debugging, it turned out that the culprit was the aspect-merger. In order to remove multiple envs, it mutated the original ExtensionData of the scope component and deleted the env from there.
This PR fixes it by cloning the entry before modifying it.
(for future reference - use Proxy to catch this issues, specifically the deleteProperty method of the Proxy).
Currently, when the component.json of a component is written and the env is set to a local one, it gets removed upon
bit import
unexpectedly. After a long debugging, it turned out that the culprit was the aspect-merger. In order to remove multiple envs, it mutated the originalExtensionData
of the scope component and deleted the env from there. This PR fixes it by cloning the entry before modifying it.(for future reference - use
Proxy
to catch this issues, specifically thedeleteProperty
method of the Proxy).