Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The docs should explain how to disable sourcemaps (or even better have them off by default) #10674

Open
j127 opened this issue Jan 10, 2025 · 1 comment
Labels
help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. should this be documented? Need to figure out whether this is something to add to documentation or not

Comments

@j127
Copy link

j127 commented Jan 10, 2025

📋 Explain your issue

I've been searching around the docs to try to disable sourcemaps, but I don't see any information on how to do that. I'm using Astro 4 and React 18.

Sourcemaps should really be disabled in production by default, because most people don't want the world to be able to read their code comments, and they don't expect that it's the default behavior.

@delucis
Copy link
Member

delucis commented Jan 10, 2025

Astro respects Vite's build.sourcemap configuration option, which can be set in the Astro config file:

// astro.config.mjs

export default {
  vite: {
    build: { sourcemap: true },
  },
};

This should be false by default I believe, so if you're seeing sourcemaps in production, it might be worth opening an issue in the Astro repo with a minimal reproduction.

@delucis delucis added should this be documented? Need to figure out whether this is something to add to documentation or not help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. should this be documented? Need to figure out whether this is something to add to documentation or not
Projects
None yet
Development

No branches or pull requests

2 participants