Webpack / Babel Flashcards

1
Q

What is Webpack?

A

A package that bundles js files together from across your project.

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

Use npm install <package-name> —save-dev</package-name>

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

What is an NPM script?

A

Terminal commands that automate repetitive tasks

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

Assuming you’ve got the npm script for building Webpack —> npm run build

Can be built in either product or development mode

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

After making changes to code in src folder you need to…

A

Rerun build command and have Webpack rebuild main.js with the new code (unless you’re watching those files for changes)

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

What is Babel?

A

A tool chain that converts code into other code. Useful for ES6 —> ES5, JSX / React, and TypeScript stripping

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

What is a Plug-in?

A

A software component that adds a feature to an existing program. (Think themes / skins)

Also a function that babel is built on.

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

What is a Webpack loader?

A

Tranformations applied to the source code of a module that allow you to pre-process files. They’re a good way to handle front-end build steps.

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

How can you make Babel and Webpack work together?

A

Add webpack.config.js file with a rule for transforming .js files. Add the plugins you’d like for executing those transforms, and then build the project normally with webpack.

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