Reputation:
I'm new to front end, just a question on webpack.
For single page application like Angular, when we use cli command ng new newproject
,so the development tool webpack is automatically installed under node_modules, which means for every project I work on, there is a webpack package installed. Isn't that duplicated and take up too much disk usage? Image I have 20 Angular projects on the disk, there are also 20 duplicated webpack package as well, can't we install webpack globally so that we only have one global webpack package?
Upvotes: 1
Views: 123
Reputation: 522250
Different Webpack versions support different things and may impose different requirements on your project. If you only install it globally, then all your projects must be compatible with that version simultaneously. This may prove to be a burden, if you want to upgrade the version to support the latest features, but upgrading requires you to update your projects in some way or another since the new version has some backwards incompatible changes.
It's better to keep versioning as localised as possible to keep it manageable.
Upvotes: 0
Reputation: 131
Basically, I guess this is because you want to handle the dependency to Webpack in each package (package.json
).
You might want to change it for another tool like rollup
or parcel
in one package for example.
Upvotes: 0