top | item 40344113

(no title)

thricegr8 | 1 year ago

This is an awesome tool and something I've been trying to do for too long. I've been trying to find ways of "quasi-replicating" SPA's like this and then doing analysis on them.

Can you talk a little bit about your approach? Any recommend readings or other tools for inspiration?

Thanks!

discuss

order

zb3|1 year ago

Thanks :)

I got the idea to write this tool years ago when I noticed that even though many frontends use code splitting, chunks can be enumerated most of the time , because if the name includes the content hash, there must be a map from chunk id to chunk hash, so by finding that map I could enumerate and download all chunks. In practice this might be more complicated, there are manifests and sometimes there's no map and the name only depends on the chunk id..

The second thing were source maps.. I saw tree-like structure in devtools so intuitively I wanted some way to "save" what I saw as files. Moreover, I figured out that there are many publicly reachable development/staging environments which save source maps on, plus the source map sometimes exists even if it's not specified in the minified file. This made me interested in the topic, but I couldn't find any tools that combine chunk detection and source map unpacking :)

Note that while source maps don't contain configuration data (like webpack config), some of this could possibly be inferred from the minified source, albeit I didn't explore this further.