<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rooGBot AI</title>
    <description>The latest articles on DEV Community by rooGBot AI (@roogbotai).</description>
    <link>https://dev.to/roogbotai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4206945%2F22b65529-5ade-4a40-a404-1b5e24d04bc8.png</url>
      <title>DEV Community: rooGBot AI</title>
      <link>https://dev.to/roogbotai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roogbotai"/>
    <language>en</language>
    <item>
      <title>Can people see my app's source code? Source maps, explained</title>
      <dc:creator>rooGBot AI</dc:creator>
      <pubDate>Sun, 25 Oct 2026 16:42:22 +0000</pubDate>
      <link>https://dev.to/roogbotai/can-people-see-my-apps-source-code-source-maps-explained-4ci6</link>
      <guid>https://dev.to/roogbotai/can-people-see-my-apps-source-code-source-maps-explained-4ci6</guid>
      <description>&lt;p&gt;If you built your app with Lovable, Bolt, Cursor or another AI tool, here's a question worth asking before you share it: &lt;strong&gt;can people see your source code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Short answer: &lt;strong&gt;some of it, always. Most of it, if you ship source maps.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Your front-end code is always public
&lt;/h2&gt;

&lt;p&gt;Every web app sends JavaScript to the visitor's browser. That code has to be public, because the browser has to run it. Anyone can open it.&lt;/p&gt;

&lt;p&gt;Usually it's been squashed (minified) into long, hard-to-read files. That makes it harder to read, but it doesn't hide anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a source map?
&lt;/h2&gt;

&lt;p&gt;A source map undoes the squashing. MDN describes it as a file that "maps between minified or transformed code received by the browser and its original unmodified form, allowing the original code to be reconstructed" (&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Source_map" rel="noopener noreferrer"&gt;MDN: Source map&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;That's really handy when you're fixing bugs. But if your live app serves its source maps, anyone can rebuild your original files in their browser, with your folder names, file names and comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters for apps built with AI
&lt;/h2&gt;

&lt;p&gt;AI app builders are great at getting something live fast. The catch is that you may never have looked at the build settings they chose. Public source maps can make it easier for someone to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read your full code&lt;/strong&gt;, including comments you never meant to share.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spot secrets.&lt;/strong&gt; If a key or password ended up in your front-end code, readable code makes it easier to find.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Find weak spots&lt;/strong&gt; in how your app talks to your database or other services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Public source maps on their own don't mean you've been hacked. They just make life easier for anyone looking for a way in.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check your live app
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your &lt;strong&gt;live&lt;/strong&gt; app (not the preview) in Chrome.&lt;/li&gt;
&lt;li&gt;Right-click, choose &lt;strong&gt;Inspect&lt;/strong&gt;, then open the &lt;strong&gt;Sources&lt;/strong&gt; panel (&lt;a href="https://developer.chrome.com/docs/devtools/sources" rel="noopener noreferrer"&gt;Chrome DevTools: Sources&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Look through the file list. If you can see a &lt;code&gt;src&lt;/code&gt; folder with your original files (like &lt;code&gt;App.tsx&lt;/code&gt; or a &lt;code&gt;components/&lt;/code&gt; folder), your source maps are probably public.&lt;/li&gt;
&lt;li&gt;You can also open one of your JavaScript files and scroll to the very end. A line like &lt;code&gt;//# sourceMappingURL=index-abc123.js.map&lt;/code&gt; means the file points to a source map. Try opening that &lt;code&gt;.map&lt;/code&gt; URL next to the script. If it loads, it's public.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MDN also notes that browsers can find a source map through a &lt;code&gt;SourceMap&lt;/code&gt; HTTP header, so it's worth checking the response headers too.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to turn them off
&lt;/h2&gt;

&lt;p&gt;It depends on what your app is built with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vite
&lt;/h3&gt;

&lt;p&gt;Many projects from AI builders use Vite. The Vite docs say &lt;code&gt;build.sourcemap&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt; by default (&lt;a href="https://vite.dev/config/build-options" rel="noopener noreferrer"&gt;Vite build options&lt;/a&gt;). If yours is set to &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;'inline'&lt;/code&gt;, maps get shipped with your app. Set it back to &lt;code&gt;false&lt;/code&gt; (or remove it):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// vite.config.js&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;sourcemap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's also a &lt;code&gt;'hidden'&lt;/code&gt; option. Per the Vite docs, it works like &lt;code&gt;true&lt;/code&gt; but leaves out the comment that points to the map. The &lt;code&gt;.map&lt;/code&gt; files are still created, so if you use it, make sure those files aren't uploaded with your site.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next.js
&lt;/h3&gt;

&lt;p&gt;The Next.js docs say source maps are off in production builds "to prevent you leaking your source on the client", unless you turn on &lt;code&gt;productionBrowserSourceMaps&lt;/code&gt; (&lt;a href="https://nextjs.org/docs/app/api-reference/config/next-config-js/productionBrowserSourceMaps" rel="noopener noreferrer"&gt;Next.js docs&lt;/a&gt;). If you find this in your config, remove it or set it to &lt;code&gt;false&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// next.config.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;productionBrowserSourceMaps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Not sure what you're using?
&lt;/h3&gt;

&lt;p&gt;You can paste something like this into your AI app builder:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Check my project's build settings. Make sure production builds do not publish source maps to the browser. For Vite, set build.sourcemap to false (or remove it). For Next.js, remove productionBrowserSourceMaps or set it to false. Don't change anything else. Then tell me what you changed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then publish again and repeat the checks above on the live site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hiding source maps is not a lock
&lt;/h2&gt;

&lt;p&gt;Turning off source maps is a good habit, but your JavaScript is still public, just harder to read. So the real fixes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Never put secret keys in front-end code.&lt;/strong&gt; In Vite, any variable starting with &lt;code&gt;VITE_&lt;/code&gt; ends up in the code sent to the browser (&lt;a href="https://vite.dev/guide/env-and-mode" rel="noopener noreferrer"&gt;Vite: env variables&lt;/a&gt;). In Next.js, &lt;code&gt;NEXT_PUBLIC_&lt;/code&gt; variables are inlined into the JavaScript sent to the browser (&lt;a href="https://nextjs.org/docs/app/guides/environment-variables" rel="noopener noreferrer"&gt;Next.js: environment variables&lt;/a&gt;). Keys for things like OpenAI or Stripe (&lt;code&gt;sk_live_...&lt;/code&gt;) belong on the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock down your database.&lt;/strong&gt; If you use Supabase, the anon or publishable key is meant to be public, but it only stays safe if Row Level Security is turned on for your tables (&lt;a href="https://supabase.com/docs/guides/getting-started/api-keys" rel="noopener noreferrer"&gt;Supabase: API keys&lt;/a&gt;, &lt;a href="https://supabase.com/docs/guides/database/postgres/row-level-security" rel="noopener noreferrer"&gt;Supabase: Row Level Security&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check for other public files&lt;/strong&gt; like &lt;code&gt;/.env&lt;/code&gt; and &lt;code&gt;/.git/config&lt;/code&gt; on your live site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your app's JavaScript is always public. Source maps make it readable.&lt;/li&gt;
&lt;li&gt;Public source maps can show your original files, folder names and comments.&lt;/li&gt;
&lt;li&gt;Check in Chrome's Sources panel, or look for &lt;code&gt;sourceMappingURL&lt;/code&gt; at the end of your scripts.&lt;/li&gt;
&lt;li&gt;Vite has source maps off by default. Next.js keeps them off in production unless you turn them on.&lt;/li&gt;
&lt;li&gt;Hiding code doesn't fix leaked keys. Keep secrets on the server.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;A note on how this was written: this article was written with AI help, and each claim was checked against the official docs linked above.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
