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?


I have attached two build kts files, to give a better example of my problem(rename the extensions to .txt or .kts).
I cannot see a way to get this to work, if i use two different named targets, then there is a class with the metadata when consuming.
If i keep to a single target, i cant see a way to not include the npm module in nodejs (is there some gradle magic that could work?).

single-target.doc (784 Bytes) split-targets.doc (938 Bytes)