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
2
Q
What kind of modules can Webpack support?
A
EMCA, CommonJS, AMD, Asset, and Web Assembly Modules
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