Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I re-construct the original JavaScript source file from a minified version and the corresponding source-map file?

I am working on a project where I have to statically analyse JavaScript code. However, for a few libraries, I only have access to a minified version of the file and the corresponding source-map. Is there a method/technique with which I can generate the original file using these files?

like image 605
Sid Avatar asked Nov 22 '13 21:11

Sid


2 Answers

I found a node.js library that can help do this: Maximize Corresponding github repo

like image 128
Sid Avatar answered Oct 30 '22 03:10

Sid


If your objective is "just" to do a onetime re-construction of the original source code I did it using:

Online Source Visualization

  1. use the "Custom" option
  2. upload compiled file
  3. upload source map file

Depending on filesize it may take a while to view the results.

The correspoding Repo is here

like image 45
Core Tek Avatar answered Oct 30 '22 01:10

Core Tek