kentcdodds / binode

63 stars 4 forks source link

Support ESM #5

Open MichaelDeBoey opened 1 year ago

MichaelDeBoey commented 1 year ago

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.

kentcdodds commented 1 year ago

I'm definitely open to a PR to fix this

dvnrsn commented 11 months ago

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")