- 26 Dec 2024
- 1 Minute à lire
- SombreLumière
- PDF
Using sourcemaps
- Mis à jour le 26 Dec 2024
- 1 Minute à lire
- SombreLumière
- PDF
Sourcemaps are a debugging aid that map the obfuscated code back to the original unobfuscated input. The mapping includes symbol names mapped from the renamed, obfuscated value back to the original name and also the source location (line and column number) back to the original source file. It’s imperative that these files are not distributed within the protected application or much of the obfuscation benefit will be lost. A comment is embedded in the protected file to indicate the location of the sourcemap file so that if it is opened in a debugger it will be automatically read and used. Consider though that your code may still be protected with the anti-debug control and so very difficult to debug. Sourcemap generation is disabled by default but can be enabled via the --sourcemap command line option.
Sourcemap configuration options | ||
Command line option | JSON configuration | Purpose |
---|---|---|
--sourcemap | "sourcemaps": { "enabled": true } | Enables the production of sourcemaps for eachprotected file |
"sourcemaps": { "outputPath": "mypath/maps" } | Set the root directory for the output of the generated .map files. By default this is the same as the output directory or file. Map files are the same name as the output file but have .map appended to the end. |