binode icon indicating copy to clipboard operation
binode copied to clipboard

Support ESM

Open MichaelDeBoey opened this issue 2 years ago • 2 comments

As @ brophdawg11 pointed out in https://github.com/remix-run/indie-stack/pull/255#issuecomment-1706780193, it seems that binode is currently CJS only

It looks like binode is CJS only at the moment to it can't pull in the ESM mocks file nor the ESM built file.

MichaelDeBoey avatar Sep 05 '23 20:09 MichaelDeBoey

I'm definitely open to a PR to fix this

kentcdodds avatar Sep 06 '23 00:09 kentcdodds

Hey @MichaelDeBoey, in the example binode is given the node flag --require which of course is not going to work anymore than running node --require ./mocks/index.js when package.json specifies type: module. But it works fine for me with the --import flag which is admittedly experimental but probably good enough for development (as seen in the indie stack "dev")

dvnrsn avatar Nov 15 '23 04:11 dvnrsn