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

fix(cli): remove source maps #32317

Merged
merged 4 commits into from
Nov 28, 2024
Merged

fix(cli): remove source maps #32317

merged 4 commits into from
Nov 28, 2024

Commits on Nov 28, 2024

  1. fix(cli): remove source maps

    Remove the source maps from the bundled CLI. The source maps are not
    really useful for customers anyway, and have the following downsides:
    
    - They are 30+MB, which we vend to customers for no benefit.
    - They tend to slow down Node as it loads and processes them. We have
      reports that on some Node versions this even leads to socket timeouts
      as the Node process was too busy loading source maps (#19930).
    
    There are 2 steps to producing a CLI build:
    
    - First compile with TypeScript -> JavaScript. Produces sourcemaps
      that are still being loaded.
    - Then bundle JavaScript -> bundle. This removes sourcemaps.
    
    Developers running a local (non-bundled) build will benefit from
    the source maps generated by TypeScript.
    
    Two other changes in this PR that came up around this:
    
    * Clarify what the `--debug` flag is for (debugging the CDK app)
      and what it's not for (debugging the CLI)
    * Only print the stack trace in a CLI error if we're on a developer
      build; due to the minification printing the stack trace on
      a bundled copy prints a 1000-character minified line which is not
      useful to anyone.
    rix0rrr committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    80876cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    981406a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    646f49f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    764cc2a View commit details
    Browse the repository at this point in the history