Rohit Garg
Rohit Garg

Reputation: 851

Get version of major libraries/modules included in webpack bundle

Is there any way to get what all libraries/script/modules included in webpack bundle from developer's console(you can consider a website is already running and you don't have access to its codebase) and also know there npm module version ?

Upvotes: 2

Views: 875

Answers (2)

Ogglas
Ogglas

Reputation: 69968

As @Seblor said. Step by step would be to open index.html file using Chrome Developer tools or similar.

There you will probably find code like:

<script src="/Scripts/dist/client.bundle.12345.0.0.js"></script>
<script src="/Scripts/dist/LICENSE.js"></script>

or

<script src="https://12345.cloudfront.net/dist/js/main-react-12345.js"></script>
<script src="https://12345.cloudfront.net/dist/js/vendor-12345.js"></script>

Navigate to either LICENSE.js or vendor-12345.js. LICENSE.js is often easier to read than vendor file but both work.

I usually search for @license, @author, @copyright and Copyright to see what libraries are used.

Upvotes: 0

Seblor
Seblor

Reputation: 7136

Webpack does not keep the module versions, which is normal because you would not need it in production.

However, you can try to get the dependencies by parsing the vendor file and looking at all the imports and require statements.

Upvotes: 3

Related Questions