JS Target skip npm dependancy for node

I have a multiplatform project, where I am using the Javascript target for both Browser and Node.
I have a scenario where I only wish to use the NPM dependancies for my Browser target and not the Node target.
I cannot see a way to conditionally do this? I tried to create two JS targets one with name “browser” and one with “node” but when i go to publish, i get an error about the metadata being identical of browser and node.
Is there a way to put an If statement in the build gradle under the source set? or is there some other smart way?

Thanks