by tropshop · 8y ago · 0 comments
Vue users are more likely to bypass NPM. They are often on-boarded with the gentler approach most familiar to those who "sprinkle in some jQuery" - Drop in a <script> tag and you are ready to rock. This approach is more likely to use a local file or from CDN.
We use rollup[1] for our production bundle. We manage all 3rd party dependencies by source control. We don't need to rely on NPM for ES5/ES6/CommonJS/AMD/Modules - We have full control of each dependency to use the code that is most fit. Sometimes that is already checked-in by the author, sometimes we need to build it, sometimes we can use the modern ES6 code directly, sometimes we can remove duplicate polyfills already in our bundle.
It takes bit more discipline, but the extra security, optimal build, and peace of mind knowing how things work, are well worth the effort to us.
Webpack is great for, among other things, combining your code into single packages instead of including many script tags. It's also useful for optimizing the output of your build in various ways which makes it very valuable for large-scale applications.