{"id":19083424,"url":"https://github.com/emrd/react-hide-codes-from-browser","last_synced_at":"2025-08-10T22:06:30.294Z","repository":{"id":252645578,"uuid":"841030482","full_name":"EmrD/react-hide-codes-from-browser","owner":"EmrD","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-11T12:55:37.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T08:57:23.529Z","etag":null,"topics":["browser","privacy","react"],"latest_commit_sha":null,"homepage":"https://react-bu-a6073.web.app/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EmrD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-11T12:41:42.000Z","updated_at":"2024-08-19T13:40:04.000Z","dependencies_parsed_at":"2024-08-12T00:31:39.347Z","dependency_job_id":null,"html_url":"https://github.com/EmrD/react-hide-codes-from-browser","commit_stats":null,"previous_names":["emrd/react-hide-codes-from-browser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EmrD/react-hide-codes-from-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Freact-hide-codes-from-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Freact-hide-codes-from-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Freact-hide-codes-from-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Freact-hide-codes-from-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmrD","download_url":"https://codeload.github.com/EmrD/react-hide-codes-from-browser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmrD%2Freact-hide-codes-from-browser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269794097,"owners_count":24476743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","privacy","react"],"created_at":"2024-11-09T02:47:26.096Z","updated_at":"2025-08-10T22:06:30.272Z","avatar_url":"https://github.com/EmrD.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"****Hide React Codes From Browser****\n\nIf you want to hide your codes in production deployment; you can do this with React.\n\nYou can test my project: https://react-bu-a6073.web.app/\n\n**To hide codes, follow these steps**\n1. Add this code to your build script in ```package.json```:\n\n   ```\n   GENERATE_SOURCEMAP=false\n   ```\n   \n3. Run your build script, for example\n\n   ```\n   npm run build\n   ```\n   \n4. Just add your ```dist``` folder to production server.\n5. Test your app.\n\n***Example Usage:***\n\nThis code was my React code:\n```\nimport { useState } from 'react'\nimport reactLogo from './assets/react.svg'\nimport viteLogo from '/vite.svg'\nimport './App.css'\n\nfunction App() {\n  const [count, setCount] = useState(0)\n\n  return (\n    \u003c\u003e\n      \u003cdiv\u003e\n        \u003ca href=\"https://vitejs.dev\" target=\"_blank\"\u003e\n          \u003cimg src={viteLogo} className=\"logo\" alt=\"Vite logo\" /\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://react.dev\" target=\"_blank\"\u003e\n          \u003cimg src={reactLogo} className=\"logo react\" alt=\"React logo\" /\u003e\n        \u003c/a\u003e\n      \u003c/div\u003e\n      \u003ch1\u003eVite + React\u003c/h1\u003e\n      \u003cdiv className=\"card\"\u003e\n        \u003cbutton onClick={() =\u003e setCount((count) =\u003e count + 1)}\u003e\n          count is {count}\n        \u003c/button\u003e\n        \u003cp\u003e\n          Edit \u003ccode\u003esrc/App.jsx\u003c/code\u003e and save to test HMR\n        \u003c/p\u003e\n      \u003c/div\u003e\n      \u003cp className=\"read-the-docs\"\u003e\n        Click on the Vite and React logos to learn more\n      \u003c/p\u003e\n    \u003c/\u003e\n  )\n}\n\nexport default App\n```\n\n***In production deployment:***\n\n```\n(function() {\n    const n = document.createElement(\"link\").relList;\n    if (n \u0026\u0026 n.supports \u0026\u0026 n.supports(\"modulepreload\"))\n        return;\n    for (const l of document.querySelectorAll('link[rel=\"modulepreload\"]'))\n        r(l);\n    new MutationObserver(l=\u003e{\n        for (const o of l)\n            if (o.type === \"childList\")\n                for (const u of o.addedNodes)\n                    u.tagName === \"LINK\" \u0026\u0026 u.rel === \"modulepreload\" \u0026\u0026 r(u)\n    }\n    ).observe(document, {\n        childList: !0,\n        subtree: !0\n    });\n    function t(l) {\n        const o = {};\n        return l.integrity \u0026\u0026 (o.integrity = l.integrity),\n        l.referrerPolicy \u0026\u0026 (o.referrerPolicy = l.referrerPolicy),\n        l.crossOrigin === \"use-credentials\" ? o.credentials = \"include\" : l.crossOrigin === \"anonymous\" ? o.credentials = \"omit\" : o.credentials = \"same-origin\",\n        o\n    }\n    function r(l) {\n        if (l.ep)\n            return;\n        l.ep = !0;\n        const o = t(l);\n        fetch(l.href, o)\n    }\n}\n)();\nvar Bi = {\n    exports: {}\n}\n  , br = {}\n  , Hi = {\n    exports: {}\n}\n  , L = {};\n/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar Yt = Symbol.for(\"react.element\")\n  , tc = Symbol.for(\"react.portal\")\n  , rc = Symbol.for(\"react.fragment\")\n  , lc = Symbol.for(\"react.strict_mode\")\n  , oc = Symbol.for(\"react.profiler\")\n  , uc = Symbol.for(\"react.provider\")\n  , ic = Symbol.for(\"react.context\")\n  , sc = Symbol.for(\"react.forward_ref\")\n  , ac = Symbol.for(\"react.suspense\")\n  , cc = Symbol.for(\"react.memo\")\n  , fc = Symbol.for(\"react.lazy\")\n  , Mu = Symbol.iterator;\n\nand more...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrd%2Freact-hide-codes-from-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrd%2Freact-hide-codes-from-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrd%2Freact-hide-codes-from-browser/lists"}