First of all, introducing modules is ES6 syntax and has nothing to do with webpack. It's just that webpack can recognize this syntax, but nodejs doesn't support it yet.
Excerpted from MDN:
import defaultMember from "module-name";
import { member } from "module-name";
member, memberN Name of the exported members to be imported. defaultMember Name which will refer to the default export from the module.
In other words, introduced through import xxx from "...", xxx is already an alias of the default export item. And import { xxx } from "..." introduced, { xxx } is just the name of the exported item, not the name when imported.
MDN
You can find these conceptual questions by yourself by searching on mdn
First of all, introducing modules is ES6 syntax and has nothing to do with webpack. It's just that webpack can recognize this syntax, but nodejs doesn't support it yet.
Excerpted from MDN:
In other words, introduced through
import xxx from "..."
,xxx
is already an alias of the default export item.And
import { xxx } from "..."
introduced,{ xxx }
is just the name of the exported item, not the name when imported.Object destructuring and assignment
Owner, you need to understand the commonly used ES6 features.
The difference is that the first one is exported through export default, and the second one is exported through export.