clearmatics / qreacto

Run standalone React components in your Quarto project!
https://clearmatics.github.io/qreacto/example.html
MIT License
34 stars 1 forks source link

Does qreacto allow for npm packages to be imported? #21

Closed HaimarR closed 9 months ago

HaimarR commented 10 months ago

I'm trying to create a React component which requires an npm package. Is this supported by qreacto? If so, how would I proceed?

dweng0 commented 9 months ago

Hey, yes but the packages have to be ESMs. the best place to find esms is esm.run, search for your package in there. it can then be imported and used directly. check out the examples for way to achieve that!

The caveat here is that non ESM packages cannot be compiled "in browser" and as a result are unsupported.