If people really want to get access to your source code they can do that fairly easily.
It is possible to slow people down to a limited degree by obfuscating code.
Maintaining obfuscated code is difficult. What you want to do is obfuscate it before deployment so that you can test and debug with the normal version. Debugging problems on a live site can be made a lot more difficult by the obfuscation.
All client-side code can be copied. If you're a web designer, your best bet is to just brand yourself well and keep innovating so that clients are more interested in the originator than the imitator.
Just write crappy code. It won't prevent copying, but it will take away the motivation to do so.
By far the most widespread method is to write so bad code that no one in their right mind would want to copy it, it's employed by approx 99% of web sites.
Is it actually a problem to you if someone snatch a piece of your code?
Sure it is a problem if someone the steal the whole site/application, but the only way you can really deal with that anyway is through standard legal means.
On the other hand, a minificator used by the person stealing the code would make this much, much harder. So some minification / obfuscation, as suggested in the other answers, is probably a good idea nevertheless.
You can use an obfuscator, if you like. It makes the source human-unreadable.
Scare them by using copyright marks in your code and a good lawyer. If they believe that you will sue them maybe the will steal form someone else.
There's no way to prevent people from seeing your source code. There are ways to obfuscate it and make it difficult to reuse, but there's no way to hide it. Also note that obfuscation makes it hard to maintain as well.
You can use an obfuscator for your code which will make site loadable but not readable to the other developers - they will not have an easy way to modify and adapt it.
©2020 All rights reserved.