Until fairly recently, npm's CLI syntax included the command of npm-bundle
; although it was subsequently deprecated and removed in version 7.0.
According to the folks at npm, this decision was made because "npm's behavior was changed to where now it prefers to install packages locally by default." This brings into focus my question(s) here.
Why does support still exist for installing packages w/ the --save-bundle
flag, even in the current version of npm? What, if any, benefits are achieved from using this flag? And, assuming there is a viable use-case scenario, does anyone know where to obtain a comparison of performance metrics?
Thinking that perhaps using this flag might help reduce build time or load speed, I initially researched the feature. But it seems that even when npm-bundle
was available, its usage and purpose were not documented or discussed much. I am inclined to wonder if the provision still exists only for legacy support or a means of organizing project packages.
Like myself, most devs probably first think of webpack
or browserify
in terms of bundlers. But does this mean npm
contained a native bundler to support production builds all along? But then why would third-party bundlers still be so popular if they only add dead weight?
And now, perhaps, it makes more sense to you as to how I became so perplexed.
https://stackoverflow.com/questions/67443707/what-advantage-does-npm-i-pkg-save-bundle-offer-over-npm-i-pkg-if-any May 08, 2021 at 11:06AM
没有评论:
发表评论