developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8.04k stars 362 forks source link

Update of @rollup/plugin-node-resolve potentially breaks imports of core modules #886

Closed PeterBurner closed 2 years ago

PeterBurner commented 3 years ago

Description

When using the node module uuid an error is thrown during runtime:

crypto.getRandomValues() not supported.

After some research I found out that from @rollup/plugin-node-resolve version 11.0.0 onwards one needs to specify the option exportConditions: ['node'] in the rollup config for it to work.
Since microbundle does not expose the rollup config the only workaround for users is to downgrade @rollup/plugin-node-resolve@10.0.0 via yarn module resolutions.

Please add this option to the generated rollup config or expose it to the user.

Related Issues

developit commented 3 years ago

We should definitely be setting that condition when --target node is passed, yep.