chore: Fix web build sourcemap paths

Issue: [WebIDE] Set up sourcemaps in Web IDE (gitlab-web-ide#497 - closed)

Description

It fixes the source maps in the GitLab VSCode Extension web build by applying the following changes to the ESBuild configuration:

  1. Disable minification outside of the CI environment.
  2. Set a sourceRoot property that helps web browsers to place the source code directory structure in a better place relative to the real javascript assets.
Before After
sad_source_map_files.png better_source_map_files.png

NOTE Line number mapping when debugging is still a bit wonky but this is true for debugging any VSCode Extension in the Web IDE 😅 . I haven't figured out why but this is a big improvement already.

Related Issues

Issue: [WebIDE] Set up sourcemaps in Web IDE (gitlab-web-ide#497 - closed)

How has this been tested?

  1. Check out this branch in the Web IDE's GitLab VSCode extension submodule.
  2. Start the Web IDE using yarn start:example
  3. Set a breakpoint in one of the GitLab VSCode Extension files in the Web Browser debugger. Be aware that line position is a bit off so your breakpoint needs to be 2-3 lines below the intended target.
  • If src/browser or src/common has been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
  • Consider an end-to-end test for significant new features that aren't covered by integration tests.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Enrique Alcántara

Merge request reports

Loading