How to conditionally include node modules for web vs native?

I understand that you can conditionally include node components based on filename. For example, I have Storage.web.ts and Storage.native.ts.

However, we have started including a new library in our app which is native only. Even though I have a conditional Libary.web.ts which does not include the library, the library is within my node_modules folder and this is causing problems. The only way I’ve discovered to fix this is to delete the folder before running build:web.

Specifically, I do rm -rf node_modules/agora_rn-uikit before I run expo build:web --no-pwa -c

Is there a way to ignore a node_module when building for web but keep it there when I build for native? I’m assuming there might be some webpack or babel config but my googling has not turned up a solution to this.