They can try to enforce that, but my understanding is that your brain is generally yours outside of working hours, and stuff you dream up is also yours.
But, obviously it’s easier to quit and then do your inventing.
It seems less risky to just not moonlight, especially if that moonlighting has the potential to turn into a high-$$$ business. Day zero IP litigation is last thing you need to be involved with when you're trying to bootstrap a technology startup. Even if you know with 100% certainly you would win, you'd be bled dry fighting BigCompany's hundreds of lawyers.
But, obviously it’s easier to quit and then do your inventing.