7

I would like to have unpack/extract all the component and js files from bundle.js (a webpack file). i left with this file only

I have googled and tried couple of ways to unpack bundle js files however it did not work out.

i have tried the solution as well. Please find for the reference

How to extract the bundle.js file in Webpack?

Kindly help me

2 Answers 2

5

A little googling around for a similar issue lead me to: https://github.com/1egoman/debundle

A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.

1
  • 4
    This suggested library is no longer maintained. Its author warns that it often fails in real world scenarios.
    – Matthew
    Nov 20, 2019 at 1:22
-1

If the bundle is uglified (which it usually is for production builds), you won't be able to get anything usable out of the bundle. When webpack is done bundling for production you are left with a bunch of unreadable code and there is no way to unbundle it (that is the whole point of webpack).

If however the bundle is not uglified, you could manually extract some modules by looking for a delimiter in the bundle which looks like /* 3 */ (numbers go on and on, they represent the module index). You could get lucky if the bundle is not very big.

Still, I wouldn't go that way, better try to contact the author of the bundle to give you access to the original source code (if possible).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.