A
A
Asya2021-08-12 01:56:01
JavaScript
Asya, 2021-08-12 01:56:01

How to split bundled code with webpack?

let's say I have first_scrypt.js and second_scrypt.js and I link them with webpack in bundle.js
but it so happened that I deleted first_scrypt.js and second_scrypt.js, how can I restore them (or partially restore them) using only bundle .js?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Kulakov, 2021-08-12
@ivankprod

A strange question, of course)) Why might this be needed? Well, if you really need it, then manually only if maps were generated, it will not be difficult)

V
Vladimir, 2021-08-12
@Casufi

1) Smart people work with git, and then in case of deleting a file, you can simply roll back to the desired version.
As far as I understand, your case is fictitious and the question of restoring the source code is of interest.
2) If sortmap building is enabled in the webpack, then the code can simply be pulled out of the Developer Tools in the browser, it will show the list of files and save all variable names and identification in the files
https://developer.mozilla.org/en-US/docs /Tools/Deb...
3) If not, then the question arises why you need to "separate" the code associated into one file. Most likely you will not separate the files, but the code structure and logic can be completely restored so that something can be corrected or the implementation copied. Identification is done by automatic code formatters, and variable names are not particularly important, since logic can also be traced from single-letter variables, and all references to the html document are not minified and remain in the code.
You can't "split" the code, but you can restore the logic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question