When using Dart 2 and the webdev build command, I get a build/main.dart.js file. At the end of this file, there is a comment pointing the source map:
//# sourceMappingURL=main.dart.js.map
However, this file doesn't exist. How do I get the .map file and Dart source files to show up in the build directory so that Chrome devtools will see them?
According to the document of webdev build, you should use webdev build --no-release instead. (but this will use DDC compiler instead.)
Update info:
By default, webdev build in release mode will remove all *.js.map file, so you can put a build.yaml file in your project root folder to deactivate dart cleanup source.
For example, (build.yaml file)
targets:
  $default:
    builders:
      build_web_compilers|dart_source_cleanup:
        release_options:
          enabled: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With