简体   繁体   English

如何从开发工具中隐藏 api 链接和 React JS 代码?

[英]How to hide api links & React JS code from Dev tools?

I've built a web app using React JS which is getting data from an API我使用 React JS 构建了一个 Web 应用程序,它从 API 获取数据

Screenshot of the app应用截图

If I go to "Inspect Elements" and go to sources, I'm able to see my code如果我去“检查元素”并去来源,我可以看到我的代码

Source Code Screen Shot源代码屏幕截图

My Question is :- Is it possible to hide this and all other code?我的问题是:- 是否可以隐藏此代码和所有其他代码? Here's the link of the App :- https://recipeee-54899.firebaseapp.com/这是应用程序的链接:- https://recipeee-54899.firebaseapp.com/

You can't hide this code as far as I know.据我所知,您无法隐藏此代码。

You can use webpack (which I saw you already use in your app) to make your code not readable.您可以使用 webpack(我看到您已经在您的应用程序中使用过)使您的代码不可读。 I suggest you'll use webpack to make a bundle of your js code into one file and production mode to minify your code so it will be very hard to read it.我建议您使用 webpack 将您的 js 代码捆绑到一个文件中,并使用生产模式来缩小您的代码,这样阅读起来会非常困难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM