You don't. If you want to be able to do stuff like that (and inevitably run into "hmm, works on my machine"-type bugs once you start sharing your code with others), you need to keep using npm.
This kind of liberty is the sort of stuff npm was designed for. It is also why npm has been causing trouble in many cases.
I was under the impression that this was about speed.
There are many use cases for this functionality, the design of a software package shouldn't instill dogma into its users. Users use software for their needs, not to sign up to a religion.
No, speed is bonus. Yarn is about reproducible dev/test/build setups. Same yarn.lock - same node_modules content. That's the primary goal.
If you think consistency across computers is a religion then I don't think we're going to find a lot of common ground here though.
Finally, yarn is not intended to replace the npm client. It is intended to replace it for a certain use case, which happens to be one many companies have. Unlike Yarn, Npm is highly flexible and obviously you like it like that. I strongly doubt it's going to stop being developed all of a sudden because some other people made Yarn. So what, exactly, is the problem?
This kind of liberty is the sort of stuff npm was designed for. It is also why npm has been causing trouble in many cases.