Wildcard or asterisk (*) vs named or selective import es6 javascript
Just wondering which one is the best way to use import: import * as Foo from './foo'; VS: import { bar, bar2, bar3 } from './foo'; In terms of efficiency, say for example, I'm using webpack for bundling all the JavaScript files. Will the first one actually importing everything even though I'm not using them in the main code? Some references that I can find are: In Airbnb style guide , they are recommending no wildcard so there will always be default import object, and this . If you use webpack with the dead code elimination provided by the new uglify, or rollupjs with tree-shaking, then the