Use exports for dependency
# support-framework
l
Use exports for dependency
@bland-vase-55884 Moving here
b
👍🏻
l
I'mma release a canary version for the exports feature
then you can try it out via
pnpm dlx plasmo@canary dev
@bland-vase-55884 can you provide me some example import statement you are imagining
i.e the ideal import you want to have
and the file path
b
Copy code
import '@rainbow-me/rainbowkit/styles.css';
I think a few other React packages do a CSS import like this too
l
kk, and the
styles.css
is like declared within the exports right
b
Yep
Just seems to not work in Parcel. Works with create-react-app and Next.js
l
yeah parcel resolver manually parse packagejson and looking strictly for main/module
but plasmo controls it so we can tell it how to resolve differently
the core reason we picked parcel was its plugin system - i.e all of its behavior can change
b
I wonder if someone already built a plugin for that
Tho, I'm making sure it's doing the right thing
the above plugin basically disregard the rest of parcel's resolver
how far can the package.json export nest?
can it go like this?
Copy code
'@rainbow-me/rainbowkit/style/deep/styles.css';
Apparently yes
@bland-vase-55884 try now with plasmo@canary
make sure your nodejs version is like 16 or so
b
Node.js v18.3.0.
l
argh...
quite tricky... parcel is trying to be smart about how it imports module, and our resolver is the first to run. Let me try something else
5 Views