webpack Flashcards

1
Q

What is Webpack?

A

Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

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

How do you add a devDependency to a package?

A

By using the –save-dev flag when running npm install.

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

What is an NPM script?

A

Code that automates a task that can be executed using npm run.

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

How do you execute Webpack with npm run?

A

Run the script it is aliased to. In our case, npm run build

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

How are ES Modules different from CommonJS modules?

A

Their syntax is even more compact that CommonJS’s; Their structure can be statically analyzed (for static checking, optimization, etc.); Their support for cyclic dependencies is better than CommonJS

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

What kind of modules can Webpack support?

A

ECMAScript modules, CommonJS modules, AMD modules, Assets, WebAssembly modules

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