Repository: flutter
Issue: [web] Incomplete sourcemaps
Labels: tool,a: debugging,platform-web,customer: google,a: build,has reproducible steps,P2,found in release: 2.2,found in release: 2.5,team-web,triaged-web

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

We are testing out Flutter 2 web for integration (and eventually fully going to flutter) into an existing app. Due to this we can not run `flutter run` and must host the files from our own app. We run into problems with debugging using flutter in this way.

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Create a new project following https://flutter.dev/docs/get-started/web
2. Build with `flutter build web --web-renderer html --csp --source-maps --null-assertions`
3. Host web build output on http://localhost
4. Open http://localhost in Chrome 
5. Open the debugger using f12

**Expected results:** <!-- what did you want to see? -->
- Original source where breakpoints can be set
- Original variable names in the variables pane

**Actual results:** <!-- what did you see? -->
- Missing original source code in the debugger sources pane due to using `sources` instead of `sourcesContent` in the sourcemap making it impossible to set a breakpoint.
	- A workaround is hosting the files specified under `sources` in the sourcemap on the webserver (but then the next issue arrises)
- The original variable names should be shown in the scope pane in the chrome debugger
	- They are completely missing in the sourcemap file
![afbeelding](https://user-images.githubusercontent.com/25741433/128364800-b55259c4-b1f2-4c83-b23d-88df40539953.png)

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
This is not possible due to integration with our "legacy" application
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing tim_flutter...

   info - Avoid using web-only libraries outside Flutter web plugin packages - lib\main.dart:2:1 - avoid_web_libraries_in_flutter

1 issue found. (ran in 1.0s)
```
The above references this code `import 'dart:html';`

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19043.1110], locale en-US)
    • Flutter version 2.0.5 at C:\dev\tools\flutter
    • Framework revision adc687823a (4 months ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc2)
    • Android SDK at C:\Users\test\AppData\Local\Android\sdk
    • Platform android-S, build-tools 31.0.0-rc2
    • Java binary at: C:\dev\tools\java\zulu8.46.0.19-ca-jdk8.0.252-win_x64\bin\java
    • Java version OpenJDK Runtime Environment (Zulu 8.46.0.19-CA-win64) (build 1.8.0_252-b14)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2018.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.6
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at C:\Users\test\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\211.7628.21
    • Flutter plugin version 58.0.3
    • Dart plugin version 211.7665

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.124
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 92.0.902.62
```

</details>