es6 modules Flashcards

1
Q

How are ES Modules different from CommonJS modules?

A

the syntax is the main difference, and the way we import and export them(import vs require etc etc)

also the internal workings are different

import: import { export1 } from “module-name”;
require: const config = require(‘/path/to/file’);

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

the es6-modules and the common js modules

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