codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.04k stars 2.27k forks source link

fix(esm-convert): read + write cases #8412

Closed CompuIves closed 6 months ago

CompuIves commented 6 months ago

When converting ESM, and there's an expression like --counter, where counter is exported, we would wrongly convert it to --exports.counter = counter, which is invalid syntax. In this case, it's sufficient to do --exports.counter, and with this change we do that.

codesandbox[bot] commented 6 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview
CompuIves commented 6 months ago

Tested code, it works on this sandbox and existing sandboxes