It is not practical to hide JavaScript files from the developer tools if you are serving a client-side rendered application. By nature, JavaScript is executed on the client’s browser, and the files need to be accessible for the application to run.
You can, however, disable source maps for your production build. This will make it harder (but not impossible) to read the code, as it won’t be formatted or mapped to the original source. However, keep in mind that the code will still be visible; it will just be minified and harder to follow
You should probably learn about minimization and obfuscation.
This will not completely hide your code, but it will make it hard to read.
There are a lot of different tools for this, just make sure the one you use, is compatible with the version of Javascript you are using, much likely ES6+.
2
Answers
It is not practical to hide JavaScript files from the developer tools if you are serving a client-side rendered application. By nature, JavaScript is executed on the client’s browser, and the files need to be accessible for the application to run.
You can, however, disable source maps for your production build. This will make it harder (but not impossible) to read the code, as it won’t be formatted or mapped to the original source. However, keep in mind that the code will still be visible; it will just be minified and harder to follow
You should probably learn about minimization and obfuscation.
This will not completely hide your code, but it will make it hard to read.
There are a lot of different tools for this, just make sure the one you use, is compatible with the version of Javascript you are using, much likely ES6+.
You can learn about Javascript obfuscation on this page:
Javascript Obfuscation Tool