Source Maps
Source maps are additional files generated during the build process that map the compiled JavaScript code back to the original source files — TypeScript, SCSS, or templates. They let you debug an application more effectively, because browser developer tools can show the original source code instead of only the transformed build output. This makes it easier to read stack traces, inspect application behavior, and identify the root cause of issues.
Source maps are a development-time aid: they are not required for the application to run, and are usually enabled while developing and turned off for production. This page explains how to enable them and how to decide where to enable them.
Recommendation for source map usage
For consuming applications, source maps should usually be:
-
enabled in development
-
optionally enabled in test or staging environments
-
disabled in production, unless there is a specific need for them and the security implications have been carefully considered
How to enable source maps
The exact configuration depends on how each application is built.
For Angular applications, see the official Angular documentation:
For Nx-based applications, see the official Nx documentation:
Enabling source maps in the shell
It is recommended to also enable source maps in the shell during development, so that the shell and the integrated application can be debugged together.
Because packages are shared at runtime between the shell and applications, having source maps enabled in the shell gives better insight into the shared dependencies and their interactions. It also avoids the minification issues that can arise when the shell is built without source maps while the application is built with them.
See the Enable shell source maps guide for how to enable source maps in the shell.
Security and operations note
|
Source maps may expose implementation details. Do not enable public production access without explicit review. |
Related
-
Enable shell source maps — how to enable source maps in the OneCX shell.