Hide or disable source in browser in vite app
To hide or disable the source in the browser for a vite app, you can focus on obfuscating or minifying the code during the build process. While this doesn't fully protect the source, it makes it harder to access. For more robust protection, consider using server-side rendering. By the way, friv games often have a similar setup for ensuring smooth performance and limited access to source files.
Hi,
Can you please clarify your request? Which Metronic version are you using?
What do you mean by disable the source in browser ?
Regards,
Sean
In a Vite app, completely hiding or disabling the source code in the browser is not possible, as browsers need access to the code to run the application. However, you can take steps to make it harder to view or reverse-engineer. Minifying the code during production builds reduces readability by removing whitespace and renaming variables. Disabling source maps in production ensures that debugging information isn't exposed, making it more challenging for someone to interpret the code. For additional obfuscation, tools can be used to further obscure the code, though this may impact performance. Sensitive logic or data should always be handled server-side to maintain security. While these methods increase difficulty, they don't provide absolute protection, so critical information should never reside in the frontend.