I am fairly new to webpack and I have a Vue project using the vue cli
. While analyzing the webpack bundle (built in production mode using vue-cli-service build
) using webpack-bundle-analyzer
, I found that one particular file bn.js
is being included multiple times in the bundle. When running npm ls bn.js
I found that it's parent dependency is webpack
itself.
`-- [email protected]
`-- [email protected]
`-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
| `-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected]
| `-- [email protected]
| `-- [email protected]
`-- [email protected]
`-- [email protected]
So my question is that why is webpack including it's own dependencies in the final bundle when webpack is added as a devDependency (earlier it was a dependency, then I changed it to devDepenency) in the project?
Or if this is the correct behavior then please point me to any docs/resources explaining this behavior.