{"id":8386,"date":"2021-04-25T23:04:14","date_gmt":"2021-04-25T21:04:14","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=8386"},"modified":"2021-04-25T23:04:14","modified_gmt":"2021-04-25T21:04:14","slug":"your-source-code-is-public-if-you-dont-know-this-simple-trick-by-shoaib-mehedi-dev-genius-apr-2021-medium","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2021\/04\/25\/your-source-code-is-public-if-you-dont-know-this-simple-trick-by-shoaib-mehedi-dev-genius-apr-2021-medium\/","title":{"rendered":"Your source code is public if you don\u2019t know this simple trick. | by Shoaib Mehedi | Dev Genius | Apr, 2021 | Medium"},"content":{"rendered":"<p>Please read <em>\u00ab<a href=\"https:\/\/medium.com\/dev-genius\/your-source-code-is-public-if-you-dont-know-this-e24a500edc5c\">Your source code is public if you don\u2019t know this simple trick.\u00bb\u00a0 by Shoaib Mehedi<\/a>. <\/em>Read it carefully.<\/p>\n<p>Then please someone may feel the urge to explain the concept of &#8220;Software Libero&#8221; to Shoaib Mehedi. Please tell him that obfuscating javascript is not a solution for his needs, quite the opposite<\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote><p>&nbsp;<\/p>\n<div class=\"\">\n<h1 id=\"0287\" class=\"fh fi fj fk b fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf bx\">Your source code is public if you don\u2019t know this simple trick.<\/h1>\n<\/div>\n<div class=\"\">\n<h2 id=\"c7fa\" class=\"gg fi fj as b gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw av\">This simple trick will save your career.<\/h2>\n<p id=\"9d0a\" class=\"js jt fj ju b gh jv jw jx gk jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn fb bx\" data-selectable-paragraph=\"\">As web developers, we should always be careful. Many possibilities like vulnerability, security issues, public keys, public source code, and many others can happen. One of the most dangerous issues is public source code.<\/p>\n<h1 id=\"bfc0\" class=\"ko kp fj as kq kr ks jw kt ku kv jz kw kx ky kz la lb lc ld le lf lg lh li lj bx\" data-selectable-paragraph=\"\">Source code and map<\/h1>\n<p id=\"135c\" class=\"js jt fj ju b gh jv jw jx gk jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn fb bx\" data-selectable-paragraph=\"\">When you build your project, the process generates a folder called \u201cbuild\u201d or any other as per framework policy. Just go to the build folder, and you will find some <code class=\"\" data-line=\"\">.js<\/code>extension files, and some are <code class=\"\" data-line=\"\">.map<\/code> extension files. The <code class=\"\" data-line=\"\">js &amp; map<\/code> files are the source and map files. The map files are also important while developing. The map helps to debug.<\/p>\n<h1 id=\"b887\" class=\"ko kp fj as kq kr ks jw kt ku kv jz kw kx ky kz la lb lc ld le lf lg lh li lj bx\" data-selectable-paragraph=\"\">Your Source Is Public<\/h1>\n<p id=\"0c3c\" class=\"js jt fj ju b gh lq jw jx gk lr jz ka kb ls kd ke kf lt kh ki kj lu kl km kn fb bx\" data-selectable-paragraph=\"\">When a web is published, then you only publish the build folder. Now from the previous section, we know that the map file is only needed to debug. If we publish the build folder with the map files, then your source code is considered.<\/p>\n<h2 id=\"3d2d\" class=\"lv kp fj as kq lw lx gj kt ly lz gm kw gn ma gp la gq mb gs le gt mc gv li md bx\" data-selectable-paragraph=\"\">Where to find source code<\/h2>\n<ul class=\"\">\n<li id=\"5fcc\" class=\"js jt fj ju b gh lq jw jx gk lr jz ka kb ls kd ke kf lt kh ki kj lu kl km kn me mf mg bx\" data-selectable-paragraph=\"\">Inspect the web page from a browser.<\/li>\n<li id=\"bffb\" class=\"js jt fj ju b gh mh jw jx gk mi jz ka kb mj kd ke kf mk kh ki kj ml kl km kn me mf mg bx\" data-selectable-paragraph=\"\">Go to the Source tab.<\/li>\n<li id=\"2182\" class=\"js jt fj ju b gh mh jw jx gk mi jz ka kb mj kd ke kf mk kh ki kj ml kl km kn me mf mg bx\" data-selectable-paragraph=\"\">There you will find the whole path of the source<\/li>\n<\/ul>\n<section class=\"fb fc fd fe ff\">\n<div class=\"n p\">\n<div class=\"ab ac ae af ag fg ai aj\">\n<h1 id=\"c7bd\" class=\"ko kp fj as kq kr ks jw kt ku kv jz kw kx ky kz la lb lc ld le lf lg lh li lj bx\" data-selectable-paragraph=\"\">Solution<\/h1>\n<p id=\"5ff7\" class=\"js jt fj ju b gh lq jw jx gk lr jz ka kb ls kd ke kf lt kh ki kj lu kl km kn fb bx\" data-selectable-paragraph=\"\">There are two simple solutions to solve the problem. The ultimate target is to remove map files before deployment. Here is a simple way you can use it. Add GENERATE_SOURCEMAP = false at your package.json script section.<\/p>\n<pre class=\"is it iu iv iw mo mp dt\"><span id=\"94bc\" class=\"bx lv kp fj lp b bu mq mr s ms\" data-selectable-paragraph=\"\">\"scripts\": {\"build\": \"GENERATE_SOURCEMAP=false}<\/span><\/pre>\n<p id=\"a4d1\" class=\"js jt fj ju b gh jv jw jx gk jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn fb bx\" data-selectable-paragraph=\"\">Removing maps manually will also work, but this is now a proper way.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<div class=\"n p gx mt mu mv\" role=\"separator\"><\/div>\n<section class=\"fb fc fd fe ff\">\n<div class=\"n p\">\n<div class=\"ab ac ae af ag fg ai aj\">\n<h1 id=\"6cb4\" class=\"ko kp fj as kq kr ks jw kt ku kv jz kw kx ky kz la lb lc ld le lf lg lh li lj bx\" data-selectable-paragraph=\"\">Conclusion<\/h1>\n<p id=\"85a6\" class=\"js jt fj ju b gh lq jw jx gk lr jz ka kb ls kd ke kf lt kh ki kj lu kl km kn fb bx\" data-selectable-paragraph=\"\">In this article, I tried to cover a simple trick some don\u2019t know about. Sometimes this little mistake makes a thread. Thank you.<\/p>\n<p id=\"b848\" class=\"js jt fj ju b gh jv jw jx gk jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn fb bx\" data-selectable-paragraph=\"\">Have a great day!<\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<p>&nbsp;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Please read \u00abYour source code is public if you don\u2019t know this simple trick.\u00bb\u00a0 by Shoaib Mehedi. Read it carefully. Then please someone may feel the urge to explain the concept of &#8220;Software Libero&#8221; to Shoaib Mehedi. Please tell him that obfuscating javascript is not a solution for his needs, quite the opposite<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2021\/04\/25\/your-source-code-is-public-if-you-dont-know-this-simple-trick-by-shoaib-mehedi-dev-genius-apr-2021-medium\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[171],"tags":[],"class_list":["post-8386","post","type-post","status-publish","format-standard","hentry","category-ethics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2bg","jetpack-related-posts":[{"id":8375,"url":"https:\/\/monodes.com\/predaelli\/2021\/04\/20\/useful-tricks\/","url_meta":{"origin":8386,"position":0},"title":"Useful tricks","author":"Paolo Redaelli","date":"2021-04-20","format":false,"excerpt":"Most of them are quite unnecessary when you have a POSIX command line (i.e. a GNU\/Linux machine) available, but they may be nevertheless useful: Website Safety & Security Check https:\/\/www.ssltrust.com.au\/ssl-tools\/website-security-check Online port scanner https:\/\/www.whatismyip.com\/port-scanner\/ when you don't have nmapFind my real IP address https:\/\/whatismyipaddress.com\/ . When you just can'tFind my\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8400,"url":"https:\/\/monodes.com\/predaelli\/2021\/05\/04\/5-awesome-css-tricks\/","url_meta":{"origin":8386,"position":1},"title":"5 Awesome CSS tricks","author":"Paolo Redaelli","date":"2021-05-04","format":false,"excerpt":"Do awesome things in fewer code lines with CSS Source: 5 Awesome CSS tricks every developer should know | by FAM | Apr, 2021 | Level Up Coding Smooth scrolling: html { scroll-behavior: smooth; } Resize images to fit img { max-width:100%; height:auto; } #3: Setting an image as cursor\u2026","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7334,"url":"https:\/\/monodes.com\/predaelli\/2020\/06\/11\/imagemagick-remove-black-borders\/","url_meta":{"origin":8386,"position":2},"title":"ImageMagick &#8211; Remove black borders","author":"Paolo Redaelli","date":"2020-06-11","format":false,"excerpt":"It is as simple as: magick mogrify -fuzz 4% -define trim:percent-background=0% -trim +repage -format jpg img.jpg Source: Stack Overflow","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5440,"url":"https:\/\/monodes.com\/predaelli\/2019\/04\/05\/unix-linux-trick-cd-back-to-the-previous-directory\/","url_meta":{"origin":8386,"position":3},"title":"Unix\/Linux trick: &#8216;cd&#8217; back to the previous directory","author":"Paolo Redaelli","date":"2019-04-05","format":false,"excerpt":"You know when you\u2019re in a very \u201cdeep\u201d directory, such as \/usr\/local\/src\/this\/that\/thatother, and you type \u201ccd\u201d and press enter by mistake ((happens a lot when you thin\u2026 Source: Unix\/Linux trick: 'cd' back to the previous directory Shortly, is as simple as \u00abcd -\u00bb. Since true knowledge lies in manpages, here's\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12998,"url":"https:\/\/monodes.com\/predaelli\/2025\/03\/26\/telegram-emoji-list-with-codes-and-descriptions-k3a\/","url_meta":{"origin":8386,"position":4},"title":"Telegram emoji list with codes and descriptions &#8211; K3A","author":"Paolo Redaelli","date":"2025-03-26","format":false,"excerpt":"After almost 2 years of using Telegram, I finally discovered that it is possible to enter emoji using its name after \u201c:\u201d character. Unfortunately I couldn\u2019t find any complete list of available emojis anywhere, so I had to dig deep into the Telegram desktop source code to generate it. It\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8729,"url":"https:\/\/monodes.com\/predaelli\/2021\/09\/29\/minding-the-gap-css-tricks\/","url_meta":{"origin":8386,"position":5},"title":"Minding the &#8220;gap&#8221; | CSS-Tricks","author":"Paolo Redaelli","date":"2021-09-29","format":"link","excerpt":"You might already know about the CSS gap property. It isn\u2019t exactly new, but it did gain an important new ability last year: it now works in Flexbox in Source: Minding the \"gap\" | CSS-Tricks","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=8386"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8386\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=8386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=8386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=8386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}