Title: ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files · Issue #31331 · angular/angular-cli · GitHub
Open Graph Title: ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files · Issue #31331 · angular/angular-cli
X Title: ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files · Issue #31331 · angular/angular-cli
Description: Command serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description The development server (ng serve), which uses Vite/esbuild, co...
Open Graph Description: Command serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description The development server...
X Description: Command serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description The development server...
Opengraph URL: https://github.com/angular/angular-cli/issues/31331
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files","articleBody":"### Command\n\nserve\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nThe development server (ng serve), which uses Vite/esbuild, consistently injects large, inline Base64 source maps into every JavaScript file it serves.\n\nThis behavior occurs even when source maps are explicitly disabled in angular.json and/or tsconfig.json. The most problematic aspect is that this transformation is also applied to pre-built, third-party packages from node_modules.\n\nThis unnecessarily inflates file sizes (often by 2-3x), which slows down page loads in development and makes debugging in browser DevTools more difficult due to the massive file content. The core issue is that the configuration to disable this behavior is not being respected. \n\n### Minimal Reproduction\n\n1. Create a new Angular project:\n ```bash\n ng new sourcemap-repro\n cd sourcemap-repro\n ```\n2. In `angular.json`, modify the configuration for the development server to explicitly disable all source maps. Under `projects.sourcemap-repro.architect.build.configurations.development`, set the `sourceMap` option:\n ```json\n \"sourceMap\": false\n ```\n *(Alternatively, using a more granular object like `{\"scripts\": false, \"styles\": false, \"vendor\": false}` also fails to prevent the issue.)*\n\n3. Run the development server:\n ```bash\n ng serve\n ```\n4. Open the application in a browser and launch the developer tools (e.g., Chrome DevTools).\n5. Navigate to the \"Network\" tab, refresh the page, and inspect any `.js` file (e.g., `main.js`, `polyfills.js`, or a chunk from `@angular/core`).\n6. View the \"Response\" or \"Source\" for that file.\n\n**Expected Behavior:**\nThe served JavaScript files should **not** contain an inline source map. The file should end without a `//# sourceMappingURL=...` comment.\n\n**Actual Behavior:**\nEvery JavaScript file has a large inline Base64 source map appended to it, directly contradicting the configuration in `angular.json`.\n\n\n\n### Exception or Error\n\n```text\n\n```\n\n### Your Environment\n\n```text\nAngular CLI: 19.2.14\nNode: 20.19.0\nPackage Manager: npm 10.8.2\nOS: darwin arm64\n\nAngular: undefined\n...\n\nPackage Version\n---------------------------------------------------------\n@angular-devkit/architect 0.1902.15\n@angular-devkit/build-angular 19.2.14\n@angular-devkit/core 19.2.14\n@angular-devkit/schematics 19.2.14\n@angular/cli 19.2.14\n@angular/compiler 19.2.14\n@angular/compiler-cli 19.2.14\n@angular/language-service 19.2.14\n@schematics/angular 18.2.11\nng-packagr 18.2.1\ntypescript 5.7.2\nzone.js 0.15.0\n```\n\n### Anything else relevant?\n\n\u003cimg width=\"793\" height=\"356\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/22cd3964-aa0d-432a-987a-eb50664007de\" /\u003e","author":{"url":"https://github.com/AlonMiz","@type":"Person","name":"AlonMiz"},"datePublished":"2025-09-28T14:33:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/31331/angular-cli/issues/31331"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bb49556f-b475-0674-c30f-9b8fd5a16d33 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB88:3615A2:BC949B:1043D72:696506BB |
| html-safe-nonce | 1851b3b89898fbf62a5872d8d36d8da08708b3e9cf418b3ebc6c311b09aecd74 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjg4OjM2MTVBMjpCQzk0OUI6MTA0M0Q3Mjo2OTY1MDZCQiIsInZpc2l0b3JfaWQiOiI0OTUyMzE3MzIwOTM1ODM1MzIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1f4f160504ee8e9a95f8d85481e6356bf58d1ba069e29953517fa5b05c5674af |
| hovercard-subject-tag | issue:3461987415 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/31331/issue_layout |
| twitter:image | https://opengraph.githubassets.com/20e7f621fd132096ae4d3fccb5658882afff31b71814851db134b68bf46e0a80/angular/angular-cli/issues/31331 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/20e7f621fd132096ae4d3fccb5658882afff31b71814851db134b68bf46e0a80/angular/angular-cli/issues/31331 |
| og:image:alt | Command serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description The development server... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlonMiz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5ab78b37645aad755632aa5585d27672721953ada88ee2fd72e109792b528c77 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ad8012c2b69c74234a24730a05d4683cea54801a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width