4

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?

3 Answers 3

4

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

Sign up to request clarification or add additional context in comments.

Comments

1

I was able to use the generated file in .dart_tool\build\generated\{PROJECT}\web\main.dart.js.map as source map of my main.dart.js. Just copy the file to the location of web build directory, then reload page.

(webdev: v2.7.10)

Comments

0

I don't have an exact answer for your question. I ended up calling dart2js manually to get unminified code.

dart2js -o app.js web/app.dart

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.