Exploring webpack for the first time in my Vue project created using the vue cli
. After examining the webpack bundle (produced in production mode with vue-cli-service build
) through webpack-bundle-analyzer
, I noticed that the file bn.js
is included multiple times in the bundle. Upon running npm ls bn.js
, I discovered that its parent dependency is actually webpack
itself.
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4c3b292e3c2d2f270c78627878627d">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfa1a0abaae2a3a6adbce2adbda0b8bcaabd8ffde1fde1fe">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3e5d4c474e4a51135c4c51494d5b4c5758477e0d100f0c100e">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1173637e666274637877683c6278767f51253f233f20">[email protected]</a>
| +-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ceee2a2e6ffccb9a2bda2bf">[email protected]</a>
| +-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb8999849c988e99828d92c699988aabdfc5dbc5da">[email protected]</a>
| | `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="690b0747031a295d4758584750">[email protected]</a>
| +-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="92f7fefefbe2e6fbf1d2a4bca7bca1">[email protected]</a>
| | `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6d0f0343071e2d59435c5c4354">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbcbdac9c8de96dac8d58afb8e958a958d">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8d9cbd68996d2cbf88d968c9689">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f69498d89c85b6c2d8c7c7d8cf">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2d1c0d7d3c6d79fd7d1d6daf2869c829c86">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6d0f0343071e2d59435c5c4354">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4c28252a2a25296124292020212d220c79627c627f">[email protected]</a>
| +-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="53313d7d392013677d62627d6a">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14797d78787166396675767d7a54203a243a25">[email protected]</a>
| `-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ed8f83c3879eadd9c3dcdcc3d4">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="700005121c19135d151e130209000430445e405e43">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="264448084c556612081717081f">[email protected]</a>
My question is why webpack is bundling its own dependencies in the final bundle, considering that webpack is listed as a devDependency (was previously a dependency before being changed to devDependency) in the project?
If this is expected behavior, please direct me to any documentation or resources explaining this behavior.