Webpack Flashcards
1
Q
What is Webpack?
A
A static module bundler. Its main purpose is to bundle JavaScript files for usage in a browser. When web pack processes your application, it builds a dependency graph which maps out the modules that your project needs and generates one or more bundles. A bundle is a distinct grouping of connected code that a has been compiled and transformed for the browser.
2
Q
How do you add adevDependencyto a package?
A
npm install —-save-dev
3
Q
What is an NPM script?
A
A convenient way to bundle common shell commands for your project in the scripts field of the package.json file. They are typically commands, or a string of commands, which would normally be entered at the command line in order to do something with your application. Scripts are stored in a project’s package.
4
Q
How do you execute Webpack withnpm run?
A
Add an npm script: “build” : “webpack” to package.json
Enter npm run build in the terminal