You can put some barriers in place, but there are a lot of ways getting around that.
In my opinion you are better of not trying to hide HTML/JS source code, but put effort into implementing actual security measures that protect the business logic/DB.