It can be made harder to steal the code, but you can't really prevent it.
For example, visit the HTML Guardian demonstration page using firefox and click on Tools > DOM Inspector.
You can view the structure of the entire page.
You can't really prevent that.
In the application we develop, we use YUI Compressor
The aim isn't to obfuscate the code, but to reduce the size so that pages load faster.
A side effect is that it makes it difficult to read.
We didn't find it necessary to prevent visitors from stealing the code.
Though you better check on that if its a requirement.
Anyway, its just my opinion - would like to hear what others have to say