Currently supported only in iOS version 6.7.2 and above
Mini Program /Mini Games bundle all JavaScript code into a single file during packaging. To facilitate developers in locating error positions when debugging on mobile devices, Mini Program /Mini Games provide Source Map support.
When ES6 to ES5 transpilation and code minification are enabled in DevTools, Source Map .map files are generated. In the development version of Mini Program, the base library uses the .map files from the code package to remap the error stack traces displayed in vConsole (this applies only to developer code files).
If you use external build scripts to process source files, you only need to place the generated Source Map files in the same directory as the source files.
For example:
pages/index.js
pages/index.js.map
app.js
app.js.map
DevTools reads and parses the Source Map files and uploads them.
Subsequently, you can use the uploaded Source Map files in the Operations Center of the Mini Program backend for error analysis.
Notes
-
Source Map files are not included in the code package size calculation and are also excluded from the code packages of the trial and production versions.
-
inline sourcemap is not included in the code package size calculation.
-
Since the development version code package includes
.mapfiles, its actual code package size is larger than that of the trial and production versions.