Remove platform specific code during prepare phase

When running the (for example) build-dev-cordova-ios script I notice that android related code and assets are ending up in the cordova folder.

then when the cordova build ios script takes over it creates output for ios but still containing android related stuff.

A good example of this is app.js that when I search for android using the safari inspector shows en enormous amount of android and other non ios related stuff.

Given that apple is going to be more strict I would like to prevent this.

Is there any easy way to do this or perhaps documentation? Or perhaps labeling all aspects with platform specific attributes that gets removed during the webpack phase of the prepare?

never mind guys, i am going the tree shaking route