es6-modules Flashcards

1
Q

How are ES Modules different from CommonJS modules?

A

es modules use ‘export default’ and ‘import’ rather than module.exports and require()

  • the syntax for import export is different
  • ecma scripts are part of the official js standards, whereas commonJS is community led and will never be accepted by browsers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What kind of modules can Webpack support?

A

EMCA, CommonJS, AMD, Asset, and Web Assembly Modules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

facts about named exports

A
  • names exports must be imported by the exact same name
  • curly braces are mandatory when importing them
  • every module can have many named exports, but can only have one default exports
How well did you know this?
1
Not at all
2
3
4
5
Perfectly