Which files are generated when executing `dart2js`? and why?

Issue

dart2js probably generates .js.map, .js.deps and .precompiled.js.

What’s the purpose of them? and I donno why dart2js doens’t remove them after finishing compile.

Solution

All files are generated by dart2js on purpose:

.js: The JavaScript output of your application

.precompiled.js: The JavaScript output but with content security policy (CSP) support

.js.map: source map file used for debugging the JavaScript code in the browser. It contains a mapping from JavaScript to Dart code lines.

.js.deps: contains a list list of all references files used for compilation, prop ably for debugging but I’m not sure about this.

Answered By – Fox32

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *