Recover the original code from a minified file and source map.
⇒ npm install
Output JSON encoded object of fileUrls -> original source code:
⇒ ./index.js "/path/to/file.js.map"
You could then pipe that into jq
to see all of the fileUrls included:
⇒ ./index.js "/path/to/file.js.map" | jq 'keys'
Then choosing one of those keys, use jq
again to access just the original source code for that fileUrl:
⇒ ./index.js "/path/to/file.js.map" | jq -r '."webpack:///app/src/cli/main.ts"'
Which you could then pipe into a file, text editor, etc:
⇒ ./index.js "/path/to/file.js.map" | jq -r '."webpack:///app/src/cli/main.ts"' > main.ts.orign
⇒ ./index.js "/path/to/file.js.map" | jq -r '."webpack:///app/src/cli/main.ts"' | $EDITOR
- https://github.com/mozilla/source-map
-
Consume and generate source maps
- mozilla/source-map#484
-
Add minimal CLI tool to recover original source
-
-